+ Reply to Thread
Results 1 to 4 of 4

Split worksheets

  1. #1
    Registered User
    Join Date
    08-10-2009
    Location
    New York, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Split worksheets

    Hi

    I have an excel worksheet with 22 columns. Columns A and B hold user identification and column C through V hold user data for different states. eg. Col C is for AZ, col D for MD and so on. I need to split the state columns into separate worksheets such that every state has it's own worksheet, with the user identification data (col A and B) repeated in each sheet.

    So basically, my sheets need to look like this:

    Sheet 1 - Col A, B, C
    Sheet 2 - Col A, B, D
    Sheet 3 - Col A, B, E
    ...
    Sheet 20 - Col A, B, V

    Any help will be greatly appreciated.

    Thanks!

  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: Split worksheets

    Try this on a copy of your workbook.
    Please Login or Register  to view this content.
    =======
    How to use the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet

    The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.
    Last edited by JBeaucaire; 08-10-2009 at 05:50 PM.
    _________________
    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
    Registered User
    Join Date
    08-10-2009
    Location
    New York, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Split worksheets

    Thanks


    It works perfectly!
    Last edited by Fawkes; 08-11-2009 at 01:40 PM. Reason: I had bad data in one of columns which caused the error. The solution was perfect

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

    Re: Split worksheets

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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