I want to use OnKey to call a sub in a worksheet. I can get this to work:
Application.OnKey "%{F9}", "Sheet1.Called_Sub"
But I want to proof it against someone rearranging the sheets and refer to the sheet by name. Worse still the name of the sheet has spaces in it(and it's not mine to change). So I'm after something along the lines of:
Application.OnKey "%{F9}", "My Work Sheet.Called_Sub"
The error that comes up is: 'The macro [Full name including workbook name and path] cannot be found'. Does anyone know the syntax please?
Thanks
Simon Rouse
Application.OnKey "%{F9}", "Sheet1.Called_Sub"
But I want to proof it against someone rearranging the sheets and refer to the sheet by name. Worse still the name of the sheet has spaces in it(and it's not mine to change). So I'm after something along the lines of:
Application.OnKey "%{F9}", "My Work Sheet.Called_Sub"
The error that comes up is: 'The macro [Full name including workbook name and path] cannot be found'. Does anyone know the syntax please?
Thanks
Simon Rouse