Excel waiting for one macro to finish before calli

2019-08-13 01:57发布

I'm using Application run to call several macros in order like this.

Sub Run_All_Macros()
  Application.Run ("Macro_1")
  Application.Run ("Macro_1")
End Sub

When I start Run_All_Macros, all the macros run in parallel. Is there a way to wait for the first macro to complete before the second is started?

1条回答
\"骚年 ilove
2楼-- · 2019-08-13 02:34

If you step through the macros (Use F8) you should see that they are running in order and not simultaneously.

I use the step through method to watch exactly what is happening and in what order. I often find I've included an error in logic, or something else, that doesn't give the desired result.

查看更多
登录 后发表回答