Macro conflict

  • Thread starter Thread starter zapper
  • Start date Start date
Z

zapper

I have a macro that consists of 2 macros.

Sub Macro3 ()
Macro1
Macro2 very simple
End Sub

Both Macro1 and Macro2 operate on the same area
of the worksheet.
They appear to be running concurrently with Macro1
finishing after Macro2.
I want Macro2 to run after Macro1 has completed.
How do I force Macro1 to finish before Macro2 kicks in?
 
Unless Macro1 calls Macro2, then Macro1 will finish before Macro2 is
called.

What do you see that makes it appear that Macro2 runs before Macro1
finishes?
 
they don't run concurrently unless macro1 kicks off an asynchronous process.
For example, If macro1 is doing a querytable update or something, then make
sure you set the BackgroundQuery property to false.

Also, make sure calculation is set to automatic if that is a consideration.
 
Fabulous long-range sleuthing, Tom.
.BackgroundQuery = False
solved my problem.
Thanks
zapper
 
JE,
Macro1 actually called Macro2. Then Macro2 ran again.
That was booboo #1.
Then I needed one more line:
.BackgroundQuery = False
Now I'm in business.
Thanks,
zapper
 
Back
Top