+ Reply to Thread
Results 1 to 4 of 4

Sort Columns to tabs

  1. #1
    Registered User
    Join Date
    12-11-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    86

    Sort Columns to tabs

    Hello

    I want to create worksheets based on what information is contained in a column. I am using the code below which is working ok.

    Please Login or Register  to view this content.
    The only problem is that everytime I change the column, I have to go into the VBA editor to point to the right one. I have tried to add an input box to prompt the user for the column name:

    Please Login or Register  to view this content.
    , but keep getting an error (I believe that this may have to do with the Const, but am not sure).

    Does anyone have any suggesstions on how this can be rectified?

    Thank you

  2. #2
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    You could try this one :
    Please Login or Register  to view this content.
    Charlize

  3. #3
    Registered User
    Join Date
    12-11-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    86

    Cod edoes not work correctly

    Hi Charlize

    Thanks for your help, but the code seems to add worksheets that aren't in the column list and then add numbers to the original worksheet!

  4. #4
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    It works fine by me. Put in the original sheet in A1 'name' and in B1 'Sorting code'. In A2 you type A2, A3 = A3, A4 = A4 ... In B2 = a, B3 = b, B4 = c, B5 = a, B6 = c, B7 = b

    Watch what happens. According to me the following worksheets will be created (a, b and c) with the heading starting at row 1 in the original worksheet. Then the active row will be copied to the new worksheet. The code loops through the rows until the last filled in row in column B. There may be NO empty value in column B of the original worksheet.

    Charlize

    ps. in the inputbox you type in b or B

+ 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