+ Reply to Thread
Results 1 to 6 of 6

distribute data in single sheet to multiple sheets

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    distribute data in single sheet to multiple sheets

    I have data in a worksheet that I need to breakdown further into multiple sheets.

    The worksheet is formatted as follows: It contains data in columns A-L. I want to breakdown the data further into sheets according to the data that is found in column G. As an example, say I have 1,000 rows of data and in column G there are a number of different branch numbers in each row. So there may be 250 rows with branch 450, another 250 rows with branch 360, another 200 rows with branch 777, and finally 200 rows with branch 888. In this case I want to create 4 new sheets (450, 360, 777, and 888) and copy only the data in the main sheet that corresponds to same branch.

    Actions would be as follows:
    copy 250 rows to tab "450"
    copy 250 rows to tab "360"
    copy 200 rows to tab "777"
    copy 300 rows to tab "888"

    Any comments are much appreciate. I have attached a data sample along with desired output, if needed. One note: the data comes in each day as one single sheet of data and the number of branches varies day-to-day, as such, code would need to create new sheets for each branch found.
    Attached Files Attached Files
    Last edited by maacmaac; 09-23-2009 at 08:33 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: distribute data in single sheet to multiple sheets

    This macro I have for this kind of work requires that the sheets be named EXACTLY by the values you will be matching to. So in your sample sheet, I had to rename the sheets to 450, 360, 777 and 888.

    Once that is done, this should work fine.
    Please Login or Register  to view this content.
    _________________
    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!)

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Re: distribute data in single sheet to multiple sheets

    That works great. Thank you. The only issue that I am going to run into, however, is the fact that I receive a data file each day formatted in the same manner but with ~5,000 rows of data and ~30 different branch numbers. I never know day-to-day how many unique branch numbers there are going to be in the data nor do I know what the values will be.

    Is there a way to first create tabs for all the uniques branch numbers and then run the code you provided? Thanks

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: distribute data in single sheet to multiple sheets

    Try this:

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

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

    Re: distribute data in single sheet to multiple sheets

    This will always verify the sheet exists, create it and format it if needed, then parse out the data.
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Re: distribute data in single sheet to multiple sheets

    Thank you for all comments. All solutions do what is expected.

+ 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