+ Reply to Thread
Results 1 to 14 of 14

Split Data based on 3 Columns into separate worksheets

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    43

    Question Split Data based on 3 Columns into separate worksheets

    Hello,

    I need to split the data into worksheets (see attached) by the Advertiser column and then by the deal year and deal code columns. I need each worksheet to be named per advertiser and deal year_deal code. I took off and replaced the data since it is sensitive information.

    Need help creating a macro or implicating one into the workbook to run for future reporting.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split Data based on 3 Columns into separate worksheets

    Give a chance to next code.
    It assume data is in sheet "Data"
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Split Data based on 3 Columns into separate worksheets

    Thank you! For some reason it keeps saying error. The 'Sub SplitData()' is highlighted in yellow and 'DDD = ObjDic.keys'. Is there something I am doing wrong? Can you give me step by step detail on how to run the macro?

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split Data based on 3 Columns into separate worksheets

    About the 'DDD = ObjDic.keys' statement, remove it, it was for debugging.
    Does the macro working with the file sent?

  5. #5
    Registered User
    Join Date
    05-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Split Data based on 3 Columns into separate worksheets

    Thank you, I took out the debug info.

    It worked with your file but when I copy and paste the actual data under the Range it now keeps giving me an error and highlighting 'Worksheets(Worksheets.Count).Name = G'

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split Data based on 3 Columns into separate worksheets

    Without a sample of your data it will difficult to understand...
    Can you prepare a sample.

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split Data based on 3 Columns into separate worksheets

    An issue is the sheet's name length : maxi = 30
    Do a test with your data

  8. #8
    Registered User
    Join Date
    05-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Split Data based on 3 Columns into separate worksheets

    how do I change the count? It is now highlighting 'Worksheets(Worksheets.Count).Name = G' in yellow.

  9. #9
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split Data based on 3 Columns into separate worksheets

    You don't have to change count it is done automatically.
    Does it happen for the first sheet to create?
    The easiest way would be to send me a file

  10. #10
    Registered User
    Join Date
    05-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Split Data based on 3 Columns into separate worksheets

    Here you go. Let me know if you need anything else.

    Thank you.
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split Data based on 3 Columns into separate worksheets

    See here your file.
    I added an additional column to get the ADVERTISER name shorter
    I removed ome sheets for file size issue to download
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split Data based on 3 Columns into separate worksheets

    I'm coming back to the origine macro and file.
    Everything is working correctly: Remove the spaces in end of ADVERTISER's names
    Attached Files Attached Files
    Last edited by PCI; 05-29-2014 at 09:02 AM. Reason: Typo

  13. #13
    Registered User
    Join Date
    05-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Split Data based on 3 Columns into separate worksheets

    Thank you! How do I do that quickly on all columns that apply?

  14. #14
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split Data based on 3 Columns into separate worksheets

    Use next code for column C
    Please Login or Register  to view this content.

+ 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. Split data into separate worksheets and sort
    By jxm1092 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2013, 05:00 AM
  2. Split data by Criteria into separate worksheets on one workbook
    By TrebleC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2013, 08:39 AM
  3. How to split excel file into separate workbooks based on number of columns?
    By nandana83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2012, 04:03 AM
  4. Split my data into separate worksheets
    By drunk8gods in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-12-2010, 04:20 PM
  5. Replies: 2
    Last Post: 09-24-2009, 06:51 AM

Tags for this Thread

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