Run 46 macros in one module

meirm

New Member
Joined
Mar 13, 2014
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I built a file which copies the same range from 46 different spreadsheets in one file to a second file with identicle spreadsheets. The macros are all sitting ib the same module. I'm looking for a macro to run them by refering to the module they're located in rather then having to code 46 calls.
 
Re: "wouldn't it just be easier to call each of the 46 macros that I already have"
No, for maintenance sakes it is easier to have a list of sheet names. It will be faster also.
What is the naming convention of the sheets to be copied?

I'll have a look later on when I have some more time.
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
You have to follow the reasoning in Post #8. I can't see that from here.
But you've found a good reason why not to go the way you want to go. Too many possibilities for things to go wrong like spelling not the same, extra spaces etc etc.
You have to go through everything to make sure there are no differences. That could be many things.
 
Upvote 0
In the end, I found a macro that lists all my macro names in a spreadsheet. Using the excel textjoin, I combine the macro name with the term call and was able to copy the entire list at on time to a macro that ran them all. It's primitive but works. I would prefer to use a more sophisticated VBA program to achieve the same thing.
 
Upvote 0
Re: "I would prefer to use a more sophisticated"
Post #11 has suggestions.
If the sheets that need copying have a part of the name in common, you can use that easy enough or a small macro to output the sheet names into a sheet but you need to let us know.
i.e. if all the sheet that need to be copied start with "Invoice" you just cycle through these sheets and copy/paste.
Or, as mentioned, use a list in a hidden sheet.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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