Capture keypress 
Author Message
 Capture keypress

I want to take some action based on user keystroke.
I tried this on selection change and it did not trigger
when I hit enter.  

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
   Application.OnKey "^{RETURN}", "ReturnProc_A"
End Sub

Sub ReturnProc_A()
  msgbox("You hit ENTER")
End Sub



Mon, 04 Jul 2005 06:10:35 GMT  
 Capture keypress
Try using the keydown event
Quote:
>-----Original Message-----
>I want to take some action based on user keystroke.
>I tried this on selection change and it did not trigger
>when I hit enter.  

>Private Sub Worksheet_SelectionChange(ByVal Target As
>Range)
>   Application.OnKey "^{RETURN}", "ReturnProc_A"
>End Sub

>Sub ReturnProc_A()
>  msgbox("You hit ENTER")
>End Sub

>.



Mon, 04 Jul 2005 06:43:58 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Capturing Keypress from Toolbar

2. capturing keypress prevents reading field value

3. how to capture keyPress event from invisible PowerPoint forms

4. how to capture keyPress event from invisible PowerPoint forms

5. Capturing ENTER keypress

6. Capturing a keypress in a document?

7. ANN: Capture Show - Free add-in to capture slide builds/pen annotations

8. In vbs exist the keypress event

9. Keypress event

10. Disabling shift keypress that prevents code execution


 
Powered by phpBB® Forum Software © phpBB Group