excel VBA - keypress code

  • Thread starter Thread starter bforster1
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top