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,444
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
30,554
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,444
@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,078,486
Messages
5,340,618
Members
399,387
Latest member
amrita34

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top