+ Reply to Thread
Results 1 to 8 of 8

Macro to sort tabs in a worksheet

  1. #1
    Registered User
    Join Date
    11-24-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    12

    Macro to sort tabs in a worksheet

    Hi All,

    I would like to use VBA to sort the tabs in my workbook. There are a couple ways I imagine this could be done. The first is sorting them based on their color, for example the black tab is first all the way to the right, and second is the blue tabs, then the green tabs, then the orange, and finally all the way to the left is the yellow tabs. The second way I can imagine doing this would be to sort by the tab name, (not alphabetical). For instance, all the way to the right would be "Controls", then one to the left would be "Summary".. etc This could be done by listing the sheet names somewhere and referencing that range in the code I believe.

    Thanks for your help!,

    MH

  2. #2
    Forum Contributor
    Join Date
    12-11-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    517

    Re: Macro to sort tabs in a worksheet

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-11-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    517

    Re: Macro to sort tabs in a worksheet

    here's another approach

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-24-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    12

    Re: Macro to sort tabs in a worksheet

    thank you, I will test this out and reply with my feedback. Very much appreciated.

  5. #5
    Forum Contributor
    Join Date
    12-11-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    517

    Re: Macro to sort tabs in a worksheet

    You are welcome

  6. #6
    Registered User
    Join Date
    11-24-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    12

    Re: Macro to sort tabs in a worksheet

    Well, The SortWorkbook macro sorted them in ascending order, but I am looking more for a custom order. The SortSheets macro did not work. Is there a way I can sort them based on a predefined list?

  7. #7
    Forum Contributor
    Join Date
    12-11-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    517

    Re: Macro to sort tabs in a worksheet

    Can you give me an example of custom order

  8. #8
    Registered User
    Join Date
    11-24-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    12

    Re: Macro to sort tabs in a worksheet

    Yes, the order, from right to left is:

    Controls
    Comments
    Overview
    Global
    ...etc there is about 20 tabs

+ 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. [SOLVED] Macro to import all tabs from a different worksheet
    By MagicMan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-06-2015, 05:29 PM
  2. Macro For Worksheet Tabs
    By Zins517 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-22-2014, 02:45 PM
  3. Replies: 6
    Last Post: 02-01-2012, 05:29 PM
  4. Macro: Split worksheet into tabs.
    By TWent in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2010, 03:48 PM
  5. Replies: 3
    Last Post: 07-18-2006, 06:40 PM
  6. Worksheet tabs in a Macro
    By jstoner50 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-10-2005, 10:25 AM
  7. [SOLVED] Re-Sort Worksheet tabs
    By Campbti in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-10-2005, 02:06 PM

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