View Full Version : Solved: Creating A Shortcut Key

07-18-2008, 04:42 PM
Hi All,

When we record a macro in excel it gives us an option to provide a shortcut ket to run that macro.

But That shortcut key is applicable only to that system & when you use that macro in some other system that shortcut key will not work.

Now my question is it possible to create a shortcut key for a particular macro through VBA coding in excel so that shortcut key is uniform for that macro.

I understand that if that shortcut key combination is already in a particular system could give us a conflict, its okay for those systems I can change the shortcut key to some other.

Any help regarding this will be great.


07-18-2008, 06:34 PM
Hi Sudhir. See the Application.MacroOptions Method in VBA help. Let me know if you need any carification beyond that...

07-19-2008, 01:09 AM
Application.OnKey "+^D","myMacro"

assigns the macro to Ctrl-Shift-D. To reset it use

Application.OnKey "+^D"

07-19-2008, 05:08 AM
Thanks Tom & XLD for your guidance.

:bow: :bow: :bow: :bow: