Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Key Strokes In Excel Macro

Status
Not open for further replies.

sgreenwood

Technical User
May 7, 2001
48
US
Hi,

Can anyone tell me what the syntax would be for entering a series of key strokes into an excel macro. I know it can be done, but I can't remember how to enter it.

In particular I am looking to put an "end up" and "end down" command.

Thanks in advance for any help!
 
Well...actually I didn't figure it out...maybe I'm going about it the wrong way.

What I'm actually trying to accomplish is creating a macro button equivilent to the "auto sum" function...except I want it to do a "=subtotal" instead of an "=sum".


If I record a macro to do it, it automatically uses the number of rows that I was subtotaling when recording the macro instead of just going to the top of the current data section.

I thought by using the keystroke commands for "end up" and "end down" I could solve this, but I don't seem to be having any luck.

Any suggestions?

Thanks
 
Play around with :

SendKeys "{END}{DOWN}", False
and
SendKeys "{RIGHT}{DOWN}{END}{UP}", True

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top