VBA Code To Split Multiple Tabs in a Workbook to a New File

calgary_excel

New Member
Joined
Nov 20, 2018
Messages
2
Hey everyone,

Im trying to copmlie for a VBA code that will help me split my master excel workbook into multiple worksheets for each department.and its sub departments.

Essentially, the master sheet is designed like
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Dept_1 Summary | Sub Department 1 | ....... |Sub Department 10
</code>Dept_2 Summary | Sub Department 1 | ....... |Sub Department 10 I want to split each department and its subdepartments to another file and save as the department name.

I have created a table with the breakdown of the tabs names that need to be split into its own workbook but am failing at trying to link the basic code to the table.

any help?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
No, the workbook has multiple tabs.
The department and sub-departments are the names of the tabs.

The tab names are for example
29500
DE0001
DE0002
29501
FI002

Essentialy I want to split the workbook with all the tabls into each seperate workbook for each department and break links in formula reference or paste as values while keeping the formatting- such as
29500
DE0001
DE0002

and then another workbook for
29501
fi002

The tab names will never change. i have a table that outlines how i want it being split, each row will be a different workbook
Dept.Tab1Tab2Tab3Tab4Tab5Tab6Tab7Tab8Tab9
29500DE0001DE0004DE0002DE0003
29501FI0002
29502AC0001AC0002AC0011AC0003AC0004AC0006
29502.1.11AC0001AC0011
29502.2AC0002
29503HR0001HR0002HR0003HR0005HR0007HR0008
29504PA0002PA0003PA0004PA0007
29505IT0001IT0002IT0003IT0004IT0005IT0006IT0007IT0008IT0009
29506SS0001SS0002SS0004SS0003
29507LC0001LC0002
29508FA0002FA0007FA0001FA0015FA0014FA0011
29509AD0005AD0009AD0010AD0014AD0018AD0020AD0021AD0027CONT
JOBJOB

<colgroup><col><col span="9"></colgroup><tbody>
</tbody>

<tbody>
</tbody>


I am at my wits end.
 
Upvote 0

Forum statistics

Threads
1,215,422
Messages
6,124,811
Members
449,191
Latest member
rscraig11

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