Calling Multiple Macros from single Macro consecutively upon completion

flashgordie

Board Regular
Joined
Jan 9, 2008
Messages
95
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I have 9 macros that function correctly on their own.

I would like to create a single macro that would run each of the individual macros in order without jumping a head.

“When they are combined (as shown below) into a single “RunAll” Macro, A through F work as expected. However H doesn’t wait unit G is complete. As G provides information that H needs to function, H throughs an error. “I” completes as expected. In the end I’m left with G and H not finishing. I expect this is because, once G starts, it then tries to execute H. As G takes longer, H starts looking for information that hasn’t been produced in time.

I am looking for help. I would like the subs to execute not only one after the other, but wait until the previous one is complete. Any ideas? Thanks!

Sub RunAll_Adj_Macros()
Call Adj_A_Insert_Run_date
Call Adj_B_Convert_Text_to_Numbers
Call Adj_C_Insert_Period_YOY
Call Adj_D_Insert_Period_YTD
Call Adj_E_Insert_Reporting_Qty
Call Adj_F_Insert_CostAmountActual_per_unit
Call Adj_G_Insert_SalesAmountActual_per_unit
Call Adj_H_Insert_Margin_Percentage
Call Adj_I_Convert_To_DollarFormat
End Sub
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try causing a delay between problematic calls. To create a 1 second delay insert a code line like
pause 1 (or pause .5 for one-half second)
VBA Code:
Sub pause(sngSecs As Single)
Dim endTime As Single

endTime = Timer
Do Until Timer > endTime + sngSecs
Loop

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top