+ Reply to Thread
Results 1 to 5 of 5

Sort worksheet by color and then by name

  1. #1
    Registered User
    Join Date
    04-07-2013
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Sort worksheet by color and then by name

    Hi,

    I would like to sort my worksheet according to colors then by name. How can I do this? I have the VBA code to sort my worksheet by colors.

    Please Login or Register  to view this content.
    Thanks in advance for your help.
    Last edited by forest18; 04-07-2013 at 11:11 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Sort worksheet by color and then by name

    The attached workbook adds a new sheet "workspace"
    columns A:B hold - tab color:tab name
    They are sorted by color code, then by name
    the sheets are moved after "workspace" in reverse order
    workspace is deleted
    Attached Files Attached Files
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    04-07-2013
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Sort worksheet by color and then by name

    Hi ProtonLeah,

    Thank you for your prompt reply. I have tried to create a new workbook but it doesn't seems working. I am pretty sure it's my problem as I am not really good in IT. Do you mind to take a look at my workbook?

    Many thanks.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Sort worksheet by color and then by name

    Build the code when almost identical question was asked...
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Sort worksheet by color and then by name

    In the worksheet you posted, you have a module named Reorder containing a sub also named reorder. Easiest fix is to rename the module, or just leave it as Module2 or whatever it was. You can't have a module and a procedure with the same name, VB won't know which one to use.
    Last edited by protonLeah; 04-09-2013 at 05:04 PM.

+ 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