excel VBA - keypress code

B

bforster1

Can someone provide code to have an event trigger whenever a key i
pressed??

I am a newbie so details would be appreciated.

Thanks
 
J

John Green

Use Application.OnKey to assign macros to keys. The following assigns a
procedure called InsertCol to the lower case a key:

Application.OnKey "a", "InsertCol"

You can also use key combinations such as "^a" for Ctrl+a. Look at OnKey in
help to get a comprehensive list of key combinations that can be used.

John Green
 
Top