Macro to move groups of sheets to new workbooks and Save

Adxax

New Member
Joined
Jul 14, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi all excel experts,

I am new to the world of macros and just starting to realise the importance and capabilities of macros.

I have a massive excel workbook (80 sheets / tabs) that I need to split into 13 new workbooks (when manually doing this, I'm using move/copy so as to preserve integrity of the "master" file) and save down as a specific file name for each workbook.

The process would go something like:
grab set of tabs from master file, move/copy to new file, save as specific name, close new file.
Go back to main file, repeat with second set of tabs, save as a different specific name, close, etc..

The number of tabs I'm moving into each workbook varies (from 26 tabs in the biggest to 2 in the smallest. I'm guessing this would be very straightforward, but am struggling to understand how I grab the specifically named tabs (the names of which will always be the same for future versions).

From the total 80 sheets, I only have to move / copy around 50 sheets meaning some of the sheets in the master file do not need to be moved anywhere.

The first tab in the master sheet however needs to be copied in all workbooks as that shows the total company performance.

There are also some other tabs which will go in more than one workbook but i have a feeling this might be tricky.

Also is there a way for me to incorporate a cell in one of the tabs I'm moving, into the save name?
for ex: let's say that Sheet1 has a location code (06. London) in cell B10. I want to reference that and save the file as "06. London".

Now that I have written this long query, I have a feeling it may not be possible but any help will be greatly appreciated. Any questions, please feel free to ask and I look forward to hearing from you.

P.S. I am very new to macros so please use dummy steps and dummy language when responding for me to understand clearly.

* The master file with 80 tabs is a workbook with the first tab showing total P&L and then remaining tabs are in the same format but showing P&Ls for each location / site. The grouping is based on UK regions then e.g. the output file "Midlands" will need to have the total company P&L tab first and then all the P&Ls for sites within the UK Midlands region.

Thank in advance.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
10,624
I'm not sure that I can offers a solution but It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach a screenshot (not a picture) of the first tab. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 

Forum statistics

Threads
1,141,581
Messages
5,707,202
Members
421,498
Latest member
matinebi

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
Top