View Single Post
  #2   Report Post  
Ernest Lai
 
Posts: n/a
Default

Not sure if I fully understand your problem.. it is a Friday afternoon after
all.

I assume you save your macros to file rather than to workbook. Either way I
would suggest not using keyboard shortcuts to execute macros. Use Alt + F8
to bring up the macro box and select the macro you wish to execute. If you
have to run more than 2 macros on the same sheet, you could write a macro to
execute X macros one after the other.

for example:

Application.Run "'Macro for xxxxxxxx.xls'!z_DONT_TOUCH_ME_1"
Application.Run "'Macro for xxxxxxxx.xls'!z_DONT_TOUCH_ME_2"
Application.Run "'Macro for xxxxxxxx.xls'!z_DONT_TOUCH_ME_3"
etc...

I havent tested this myself however...
If the macros are running on the wrong sheet because you have 2 or more
open. You could set your macros to only run on a specifically "named" sheet.
So if you do not rename a sheet it wont run.

Hope some of this helps you, if not I hope it was an interesting read.

Ernest

"Bill Martin" wrote:

Over time I've accumulated a lot of macros I've written for various things. And
inevitably, sometimes they get the same Ctrl key assigned to them since they're
not expected to both be active at once.

Occasionally however I'll have one spreadsheet just parked in the background
while I quickly check or touch another. I keep getting screwed up when I try to
execute a macro on the active sheet, but one from the idle sheet executes
instead -- totally screwing up my active data.

It would seem there would be some way to tell Excel that when there's unexpected
conflict, just execute the macro from the active sheet. I haven't been able to
stumble into it however.

Is there a general solution to this general problem, or must I be more rigorous
in not assigning the same letter to two different macros in unrelated
spreadsheets? Which of course would beg the question what to do when more than
26 macros exist in my total Excel system...

Thanks...

Bill