+ Reply to Thread
Results 1 to 2 of 2

Splitting out Excel data to multiple files based on one column's values

  1. #1
    Registered User
    Join Date
    07-27-2011
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2003
    Posts
    2

    Splitting out Excel data to multiple files based on one column's values

    I have a large data set which I have to split out to multiple excel spreadsheets, based on the value in one of the columns. Say for example column D is the identifier, a company ID . I have multiple rows with the same company ID but thousands of different company IDs. The code should find all the rows containing each company ID, create a separate file for each company, and write into each file only the data corresponding to that company.

    The master spreasheet would look like this:

    Company ID Order date Quantity
    1 5/1/2011 1000
    1 5/5/2011 1500
    3 6/1/2010 100
    6 7/1/2011 5000
    1 7/7/2011 500

    File "1.xls" would look like this:
    Order date Quantity
    5/1/2011 1000
    5/5/2011 1500
    7/7/2011 500

    File "3.xls" would look like this:
    Order date Quantity
    6/1/2010 100

    File "6.xls" would look like this:
    Order date Quantity
    7/1/2011 5000

    I hope I was clear enough. Thanks in advance for the help!
    Last edited by machos; 07-27-2011 at 10:20 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Splitting out Excel data to multiple files based on one column's values

    'SHEET1 TO MANY WORKBOOKS
    Here's a macro for parsing rows of data from one sheet to many workbooks named for the same values.My macro names the workbooks for values in the column PLUS today's date, you can take a stab at removing the date part...or leave it in, it's a good technique.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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