Excel 2007 Custom ShortCut Keys



I can override almost any Excel shortcut Key by using

Application.OnKey key, Macroname

For example, this uses the [CTRL+SHIFT+ 9 aka left/open parens "("] and
overrides the built-in command to Unhides any hidden rows within the

Application.OnKey "+^9", "MyMacro"

Now [CTRL+SHIFT+ (] runs MyMacro.

HOWEVER, no matter what I've tried, I cannot override

I tried to tell Excel to do nothing with the shortcuy key by using a blank

Application.OnKey "+^0", "" or
Application.OnKey "+^{)}", "" note: you have to use {} to esacpe the ")"

then set the shortcut key to be custom and run MyMacro.

Application.OnKey "+^0", "MyMacro" or
Application.OnKey "+^{)}", "MyMacro"

pressing [CTRL+SHIFT+ )] will cotinue to run the built-in command
Unhides any hidden rows within the selection.

Is there special something about [CTRL+SHIFT+ )] aka [CTRL+SHIFT+ 0] in
Excel 2007?

Bob Phillips

Can't be, I have just tried it and it works fine here

application.OnKey "^+0","Test"

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