How to split multiple worksheets of data by column value and output to separate files?

Nickun

New Member
Joined
Aug 27, 2019
Messages
2
I have an Excel 2010 workbook (let's call it 'Master') with many worksheets, whatever name.
Each worksheet has data structured as shown below. One of the columns has an identifier, such as a supplier code. Both sheets on the Master are sorted on Column1_header.
Note: The actual structure is slightly different, in that Sheet2, Sheet3... contains additional columns, and different data and number of rows associated with each supplier code.

What I need is to split the Master into multiple separate Workbooks, such that:


  • There is a separate output file (workbook) for each supplier code value.
  • The name of each output file contains the associated Supplier name (ex: 1.Superee_Content)
  • Each output file workbook replicates the structure of Master, i.e. has the same worksheets. Each worksheet has the same look and formatting as they do on the Master.
  • The worksheets on each separate output file contain ONLY the rows for the associated Suppliercode_header value (e.g. "Superee"). So file "Superee_data.xlsx" would contain Sheet1 with the rows for "Superee", and Sheet2 with however many rows associated with "Superee" on that sheet.....
  • Any formatting, such as column width, cell color, font size, etc. on the column headers on the Master are preserved in the split-up files, and (ideally) the column filter buttons.
I know it takes a VBA macro, but have novice VBA experience. I have an macro for splitting a single worksheet and copying some additional worksheets, but it only filtered one worksheet and I couldn't quite get it to do what I need here.

Here the file I need help and the file example after split.

https://drive.google.com/file/d/1b3BygYQB8zNtpn1YCH55aOFr47DN6Qom/view?usp=sharing
https://drive.google.com/file/d/1Ct9iBvOv2UuRaIs1V3HRQ8_6sVgPWx1o/view?usp=sharing

Many thanks for your support!

 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
What is the purpose the "Template" sheet? Is the supplier code in column C in each sheet? Where is the supplier name located? I don't see "Superee" anywhere on the sheets.
 
Upvote 0
What is the purpose the "Template" sheet? Is the supplier code in column C in each sheet? Where is the supplier name located? I don't see "Superee" anywhere on the sheets.
Hello

“Template” sheet I just want sheet have run button, path for where files will be save, and write the content for file’s name. Yes supplier code in column C for every sheet. Superee is just example, in file have column supplier name XYZ1 2 3
 
Upvote 0
Cross posted multiple sites.

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Please supply links to all other sites where you have asked this question.
 
Upvote 0
@Nickun
Please comply with the Moderator's request and post the required links. After you have done so, let us know in a new response.
 
Upvote 0

Forum statistics

Threads
1,224,737
Messages
6,180,657
Members
452,992
Latest member
TokugawaIesuma

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