View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hubisan Hubisan is offline
external usenet poster
 
Posts: 8
Default Determine when Enter Key is pressed in a sheet??

It is possible with application.onkey. Example is with HOME-Key, for
other keys check VBA help inside Excel or look for it on the web:

Sub StartOnKey()
'Run this sub to make the HOME-key run the "SubHello" procedure
Application.OnKey "{HOME}", "SubHello"
End Sub

Sub SubHello()
'Pressing HOME will run this procedure
MsgBox "hallo"
End Sub

Sub StopOnKey()
'Run this sub to return HOME-Key to its normal meaning.
Application.OnKey "{HOME}"
End Sub

You can use Workbook_Open() and run application.onkey to bind a
procedure to a key as soon as the workbook is opened.

Hubisan