+ Reply to Thread
Results 1 to 4 of 4

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

  1. #1
    Registered User
    Join Date
    08-27-2019
    Location
    England
    MS-Off Ver
    2010
    Posts
    1

    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.

    drive.google.com/file/d/1b3BygYQB8zNtpn1YCH55aOFr47DN6Qom/view?usp=sharing
    drive.google.com/file/d/1Ct9...ew?usp=sharing
    Many thanks for your support!

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Directions :

    • Use the SaveCopyAs method to create a new workbook (to see in VBA help).
    • Open the new workbook
    • For each worksheet, apply a filter in order to remove all the not necessary rows …

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

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

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. I have added the link for you this time, as a courtesy.)

    https://chandoo.org/forum/threads/ho...e-files.42448/
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

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

    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating a macro to split data into separate workbooks and separate worksheets
    By jfish07 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2019, 10:48 AM
  2. [SOLVED] Need vba to split data into multiple worksheets based on column of P & save wb with FY 16
    By johnmacpro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2016, 05:47 AM
  3. Replies: 3
    Last Post: 06-23-2015, 03:58 PM
  4. Replies: 9
    Last Post: 08-25-2014, 04:52 PM
  5. [SOLVED] Split worksheets to separate files
    By ksteffin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2013, 06:04 AM
  6. Split my data into separate worksheets
    By drunk8gods in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-12-2010, 04:20 PM
  7. Replies: 3
    Last Post: 08-02-2006, 12:35 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1