Run multiple macros in order

Dokat

Active Member
Joined
Jan 19, 2015
Messages
304
Office Version
  1. 365
Hi,

I have 20 macros that i'd like to run in order. I use below code however it returns Compile Error: Sub or Function not defined pop up window. What may cause this issue? Thanks

VBA Code:
Sub RUN()

    Call WBC
    Call WBA
    Call WRO
    Call WGI
    Call WFP
    Call WGP
    Call WMP
    Call MPM
    Call MTM
    Call MHI
    Call MDW
    Call CFP
    Call CPE
    Call CWC
    Call RBO
    Call RPE
    Call RTA
    Call OSA
    Call VBA
    Call VSA

End Sub
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If you hit "Debug", which line of code is highlighted?

Do all of these procedures exist in Standard/General Modules, or in specific sheet modules?
Do the all exist in the same module?
Are they marked Public or Private?

Also, NEVER use reserved words like "Run" or "VBA" for the names of procedures (reserved words are words that are already used by Excel/VBA in names of functions, properties, methods, etc).
Doing so can cause errors or unexpected results.
 
Upvote 0
If you hit "Debug", which line of code is highlighted?

Do all of these procedures exist in Standard/General Modules, or in specific sheet modules?
Do the all exist in the same module?
Are they marked Public or Private?

Also, NEVER use reserved words like "Run" or "VBA" for the names of procedures (reserved words are words that are already used by Excel/VBA in names of functions, properties, methods, etc).
Doing so can cause errors or unexpected results.
When i debug it highlights "Sub RunAllMacros()" in yellow.

Yes they are all in the sheet("Summary" and they are not private
 
Upvote 0
Try moving all code to a General/Standard module, and move it out of the "Summary" sheet module.

If that does not work, then start from the ground up.
Comment out ALL of the macros it is calling, except for the first one.
Does that work?
If not, what if you try running that one macro, directly. Does that work?

Once you get the first one to work, then uncomment out the second one, and test again.
Keep repeating this process until all are working.
 
Upvote 0
Try moving all code to a General/Standard module, and move it out of the "Summary" sheet module.

If that does not work, then start from the ground up.
Comment out ALL of the macros it is calling, except for the first one.
Does that work?
If not, what if you try running that one macro, directly. Does that work?

Once you get the first one to work, then uncomment out the second one, and test again.
Keep repeating this process until all are working.
I am really confused. I am still getting the same error message. Please see attached image of the error.
 

Attachments

  • Test.png
    Test.png
    21.4 KB · Views: 10
Upvote 0
Try moving all code to a General/Standard module, and move it out of the "Summary" sheet module.

If that does not work, then start from the ground up.
Comment out ALL of the macros it is calling, except for the first one.
Does that work?
If not, what if you try running that one macro, directly. Does that work?

Once you get the first one to work, then uncomment out the second one, and test again.
Keep repeating this process until all are working.
There was a typo in the in the macro names i corrected it and it seems to be working. But it is taking too long to run. Its been 10 mins and its still going
 
Upvote 0
But it is taking too long to run. Its been 10 mins and its still going
That could mean that your individual macro code is inefficient and needs to be fixed up.
You haven't posted any of it, so we cannot make that determination of offer any suggestions.
 
Upvote 0

Forum statistics

Threads
1,216,195
Messages
6,129,458
Members
449,510
Latest member
David Clark

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