VBA enter

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
paddycorcoran
Posts: 17
Joined: Tue Jun 28, 2011 11:54 am

How do I simulate hitting the "enter" key in VBA script?

Ive tried SendKeys "{Enter}" and it doesnt work

Thanks :-)
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

Put this in as a workbook open event.

Private Sub Workbook_Open()

Application.OnKey "{ENTER}", "MySub"

End Sub

Substitue "MySub" with the name of your own subroutine, then it will run whenever the enter key is pressed.
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”