View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Green[_4_] John Green[_4_] is offline
external usenet poster
 
Posts: 47
Default excel VBA - keypress code

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




"bforster1 " wrote in message
...
Can someone provide code to have an event trigger whenever a key is
pressed??

I am a newbie so details would be appreciated.

Thanks.


---
Message posted from http://www.ExcelForum.com/