MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Controlling the sequence of when Macros are run


Posted by ereit on October 25, 2000 9:25 PM

I have a workbook that runs a macro (call it "1" every time an input is made on a worksheet "A".

After macro "1" runs, worksheet "B" automatically gets updated and recalculates based on the output of the macro "1".

I would then like to run macro "2" based on the recalculated worksheet "B".

My question is; How do I trigger macro "2" to run only after worksheet "B" recalculates?

Anyone have any ideas?

Ereit


Posted by Celia on October 26, 2000 3:45 PM

Ereit
Call Macro2 from Macro1
Celia

Posted by ereit on October 26, 2000 5:30 PM

Calling Macro 2 from Macro 1 will not work properly because I need workbook B to recalculate before Macro 2 is run and after Macro 1 is run.

Any other suggestions?

Ereit

Posted by Celia on October 26, 2000 5:48 PM

It should work if you call macro2 at the end of macro1. If it doesn't work, you can try to put in code to recalculate sheet2 at the start of macro2 or at the end of macro1.
Celia