Can VBA intercept keypress within Excel ? 
Author Message
 Can VBA intercept keypress within Excel ?

Has anyone be able to find a method to intercept a key that has been pressed
within Excel VBA? All I want is to intercept whether a user has pressed F5
button (not as part of a textbox control).

Oscar



Thu, 14 Apr 2005 21:23:28 GMT  
 Can VBA intercept keypress within Excel ?
Onkey was the right command.
Thank you Tom and relater.
Oscar



Quote:
> I assume you mean in the VBE?
> Stephen Bullen has sample code that does that:

> http://www.BMSLtd.co.uk/Excel/default.htm

> If you just mean in Excel, look at the Onkey command.

> Regards,
> Tom Ogilvy



> > Has anyone be able to find a method to intercept a key that has been
> pressed
> > within Excel VBA? All I want is to intercept whether a user has pressed
F5
> > button (not as part of a textbox control).

> > Oscar



Thu, 14 Apr 2005 23:57:38 GMT  
 Can VBA intercept keypress within Excel ?
I assume you mean in the VBE?
Stephen Bullen has sample code that does that:

http://www.BMSLtd.co.uk/Excel/default.htm

If you just mean in Excel, look at the Onkey command.

Regards,
Tom Ogilvy


Quote:
> Has anyone be able to find a method to intercept a key that has been
pressed
> within Excel VBA? All I want is to intercept whether a user has pressed F5
> button (not as part of a textbox control).

> Oscar



Thu, 14 Apr 2005 22:25:28 GMT  
 Can VBA intercept keypress within Excel ?
How about: OnKey
Example
This example assigns "InsertProc" to the F5

key.Application.OnKey "{F5}", "InsertProc"


Quote:
> Has anyone be able to find a method to intercept a key that has been
pressed
> within Excel VBA? All I want is to intercept whether a user has pressed F5
> button (not as part of a textbox control).

> Oscar



Thu, 14 Apr 2005 22:25:34 GMT  
 Can VBA intercept keypress within Excel ?
Thanks Tom,
the link showed all necessary info. I've got it working now.
Oscar



Quote:
> Has anyone be able to find a method to intercept a key that has been
pressed
> within Excel VBA? All I want is to intercept whether a user has pressed F5
> button (not as part of a textbox control).

> Oscar



Thu, 14 Apr 2005 23:54:43 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Intercepting query error messages within a VBA procedure

2. Intercepting keypresses

3. Intercepting Keypress

4. intercept keypress?

5. Assing single keys to macros // intercept keypresses

6. Gradient & Intercept Excel VBA

7. Intercept mouse scrolling (using the wheel) within forms (Access '97)

8. Intercepting Close event through AutoClose macro ( also intercepting FilePrint and FileSave)

9. Asking Excel Masters - Intercepting an Excel Msg

10. Intercept XL info message with VBA


 
Powered by phpBB® Forum Software © phpBB Group