JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,691
- Office Version
- 365
- Platform
- Windows
I already have the code in workbook module, but I have assigned it to a keyboard shortcut (Ctrl+d) and that works in all of the sheets in that workbook.
What's the recommended way to restrict the macro so that it only runs when called from one sheet?
Can I restrict the shortcut to just one sheet?
If not, can I query the sheet name in the macro and if not the right sheet, either just exit or issue a warning message?
If I do that, should I use the raw sheet name (sheet26) or the name I have assigned to it. I am assuming the raw name is safer and will still work if I should happen to rename the sheet.
Thanks for any suggestions.
What's the recommended way to restrict the macro so that it only runs when called from one sheet?
Can I restrict the shortcut to just one sheet?
If not, can I query the sheet name in the macro and if not the right sheet, either just exit or issue a warning message?
If I do that, should I use the raw sheet name (sheet26) or the name I have assigned to it. I am assuming the raw name is safer and will still work if I should happen to rename the sheet.
Thanks for any suggestions.