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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Macros

Status
Not open for further replies.

north2060

Programmer
Apr 11, 2002
23
AU
Please help me to record keystrokes, for example, CTRL+HOME in Excel macro so that it moves my cursor in the same location even if I use the filter.
 
You can use this:
[blue]
Code:
Sub test()
   SendKeys ("^{HOME}")
End Sub
[/color]

But you can't just use F5 from the VBA editor or the keys will be sent to that window instead of Excel. The worksheet must have the focus. Either assign a macro short-cut key or use Alt-F8 to invoke the macro when the worksheet has focus.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top