Macro conflict

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?
 
J

JE McGimpsey

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?
 
T

Tom Ogilvy

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.
 
Z

zapper

Fabulous long-range sleuthing, Tom.
.BackgroundQuery = False
solved my problem.
Thanks
zapper
 
Z

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top