I'm trying to tie macro to a key combinations in Excel 2010 (v14.0).
In the ThisWorkbook code I've:
Option Explicit Private Sub Workbook_Open() Application.OnKey "^+1", "Foo" Application.OnKey "^+0", "Bar" End Sub In the Module1 code:
Option Explicit Sub foo() MsgBox "hello" End Sub Sub bar() MsgBox "world" End Sub When I press CTRL+SHIFT+1 Excel says "hello". When I press CTRL+SHIFT+0 Excel does not say "world".
I cannot get Application.OnKey to work with ^+0 for any macro. Is there a way to do this? Why doesn't the code above work?