VBA To run multiple modules that have multiple subs()

drop05

Active Member
Joined
Mar 23, 2021
Messages
285
Office Version
  1. 365
Platform
  1. Windows
Hello, I am trying to see if there is a way to have a module in VBA that runs different modules that have different subs(), I am going to put that into a button a user can press to do so
Example:
Say it is called MasterMod
I want mastermod to run
Mod1
Mod2
Mod3

Mod 1 has code for sub Name1(), and another sub called Name2()
Mod 2 has code for sub Test1(), another sub called Test2(), and a third sub called Sub Test3()
Mod 3 has one sub called Last1()

Is there a way to have one module run the three modules and the code inside them so they do all the tasks they are supposed to do?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You have to run the subs seperately like this
Or in what ever order you wish
VBA Code:
Sub RunAll
Name1()
Name2()
Test1()
Test2()
Test3()
Last1()
End Sub
 
Upvote 0
You have to run the subs seperately like this
Or in what ever order you wish
VBA Code:
Sub RunAll
Name1()
Name2()
Test1()
Test2()
Test3()
Last1()
End Sub
and it will run in the way i have it ordered?
is there a way to add like a status bar at the bottom of the excel doc showing a message like, when its doing name 1 and 2 it shows, "Running name(s)" then when it gets to the test 1-3, it shows "running test(s)"?
 
Upvote 0
and it will run in the way i have it ordered?
Yes.

is there a way to add like a status bar at the bottom of the excel doc showing a message like, when its doing name 1 and 2 it shows, "Running name(s)" then when it gets to the test 1-3, it shows "running test(s)"?
Check out these links here:

Just note the caveats and drawbacks of doing so (need to add more code, could slow your code down).
 
Upvote 0
Yes.


Check out these links here:

Just note the caveats and drawbacks of doing so (need to add more code, could slow your code down).
awesome thank you so much I will test this and good call I will more than likely leave that out just through id be a little fancy
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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