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!

 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,515
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.
 

Nickun

New Member
Joined
Aug 27, 2019
Messages
2
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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,270
Office Version
365
Platform
Windows
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.
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,515
@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.
 

Forum statistics

Threads
1,082,144
Messages
5,363,381
Members
400,732
Latest member
robcooper2001

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top