![]() |
Macro shortcuts are running macros in different open workbook
I use the same macro shortcuts in different workbooks. Sometimes the
shortcuts run the same macro and act on the active worksheet. In those cases if the shortcut runs the macro from a non-active workbook it will still work. But one of the shortcuts has a different meaning in another workbook, and if the shortcut decides to run the macro in that workbook then it doesn't work. When I use a shortcut how do I get it to run the macro in the active workbook? Don. www.donwiss.com (e-mail link at home page bottom). |
Macro shortcuts are running macros in different open workbook
Don Wiss brought next idea :
I use the same macro shortcuts in different workbooks. Sometimes the shortcuts run the same macro and act on the active worksheet. In those cases if the shortcut runs the macro from a non-active workbook it will still work. But one of the shortcuts has a different meaning in another workbook, and if the shortcut decides to run the macro in that workbook then it doesn't work. When I use a shortcut how do I get it to run the macro in the active workbook? Don. www.donwiss.com (e-mail link at home page bottom). Excel exhibits some bizarre behavior if macros are assigned the same shortcuts or if 2 files with macros of the same name are open. The behhavior varies depending on the order the files containing the macros were opened. <IIRCNormally the active shortcuts belong to the current active file if it has macros, otherwise the last active file containing macros. So if 2 open files use the same shortcut to run a macro, the 1st file that uses the shortcut will run its associated macro. It's usually better to assign macros to a button or menuitem AND use this statement at the top of each code module... Option Private Module Option Explicit -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Macro shortcuts are running macros in different open workbook
On Sat, 24 Mar 2012 01:58:24 -0400, GS wrote:
Don Wiss brought next idea : I use the same macro shortcuts in different workbooks. Sometimes the shortcuts run the same macro and act on the active worksheet. In those cases if the shortcut runs the macro from a non-active workbook it will still work. But one of the shortcuts has a different meaning in another workbook, and if the shortcut decides to run the macro in that workbook then it doesn't work. When I use a shortcut how do I get it to run the macro in the active workbook? Excel exhibits some bizarre behavior if macros are assigned the same shortcuts or if 2 files with macros of the same name are open. The behhavior varies depending on the order the files containing the macros were opened. <IIRCNormally the active shortcuts belong to the current active file if it has macros, otherwise the last active file containing macros. So if 2 open files use the same shortcut to run a macro, the 1st file that uses the shortcut will run its associated macro. It's usually better to assign macros to a button or menuitem AND use this statement at the top of each code module... It has to be a keyboard macro, as it gets data from the ActiveCell.Row and puts a string into the clipboard. There are three macros, each putting different strings into the clipboard. The two spreadsheets are similar, with ISBN numbers in column B. I removed the shortcut in the other different workbook that was the same. I thought about it and realized that it was no longer needed. So now it doesn't matter which macro it runs, as they are identical and only read column B of the ActiveCell.Row. Option Private Module Option Explicit I am using Excel 97. I have always used Option Explicit. I have never used Option Private Module. Don. www.donwiss.com (e-mail link at home page bottom). |
Macro shortcuts are running macros in different open workbook
On Sat, 24 Mar 2012 05:10:06 -0400, Don Wiss wrote:
I am using Excel 97. Correction. It is Excel 2002. Don. www.donwiss.com (e-mail link at home page bottom). |
All times are GMT +1. The time now is 08:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com