0
The article at the following site provides a tip for preventing a global keyboard shortcut from executing the wrong VBA code when two different macros in two different worksheets are assigned the same keyboard shortcut (Ctrl + Letter).
http://excel.tips.net/T002872_One_Shortcut_for_Two_Macros.html
The article suggests a solution but doesn't provide sample code. Can anybody tackle the following scenario in VBA?
Solution:
You could maintain the same shortcut keys by adding some code to the beginning of each macro. Have each macro check the name of the active workbook. If the name matches the expected name for that macro, then the code can continue to execute. If it does not match, then the code can activate the other workbook and directly run the macro in that one.
Just need the code... hmf
Thanks!
You should do some research, get started with VBA and ask for help when you are stuck somewhere. SU isn't a code writing service. – Karan – 2015-05-08T02:20:28.587