Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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). |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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). |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open workbook from code without running macros | Excel Programming | |||
Open workbook from code without running macros | Excel Programming | |||
Running macro on open of workbook? | Excel Programming | |||
Open workbook without running Macros | Excel Programming | |||
macro not running on workbook open | Excel Programming |