ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2007 Custom ShortCut Keys (https://www.excelbanter.com/excel-programming/441317-excel-2007-custom-shortcut-keys.html)

Kevin

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
selection.

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

Now [CTRL+SHIFT+ (] runs MyMacro.

HOWEVER, no matter what I've tried, I cannot override
[CTRL+SHIFT+ 0] aka [CTRL+SHIFT+ )]

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

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[_4_]

Excel 2007 Custom ShortCut Keys
 
Can't be, I have just tried it and it works fine here

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

--

HTH

Bob

"Kevin" wrote in message
...
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
selection.

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

Now [CTRL+SHIFT+ (] runs MyMacro.

HOWEVER, no matter what I've tried, I cannot override
[CTRL+SHIFT+ 0] aka [CTRL+SHIFT+ )]

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

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?












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

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