ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add shortcut key or hot key via vba (https://www.excelbanter.com/excel-programming/322405-add-shortcut-key-hot-key-via-vba.html)

job

Add shortcut key or hot key via vba
 
Anyone know how to programatically add hotkeys to existing subs via vba?



Ben

Add shortcut key or hot key via vba
 
you could use the OnKey method eg.


application.OnKey "^{a}", "yoursub"

will assign the key shortcut crtl+a to the sub "yoursub"

"Job" wrote:

Anyone know how to programatically add hotkeys to existing subs via vba?




job

Add shortcut key or hot key via vba
 
Thanks Ben!
"ben" wrote in message
...
you could use the OnKey method eg.


application.OnKey "^{a}", "yoursub"

will assign the key shortcut crtl+a to the sub "yoursub"

"Job" wrote:

Anyone know how to programatically add hotkeys to existing subs via vba?







All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com