Results 1 to 5 of 5

Thread: How to split multiple worksheets of data by column value and output to separate files?
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

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

    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/1Ct9...ew?usp=sharing

    Many thanks for your support!


  2. #2
    Board Regular mumps's Avatar
    Join Date
    Apr 2012
    Location
    Toronto, Canada
    Posts
    8,299
    Post Thanks / Like
    Mentioned
    95 Post(s)
    Tagged
    5 Thread(s)

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

    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.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    New Member
    Join Date
    Aug 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

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

    Quote Originally Posted by mumps View Post
    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

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,177
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

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

    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.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  5. #5
    Board Regular mumps's Avatar
    Join Date
    Apr 2012
    Location
    Toronto, Canada
    Posts
    8,299
    Post Thanks / Like
    Mentioned
    95 Post(s)
    Tagged
    5 Thread(s)

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

    @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.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •