Results 1 to 5 of 5

Sort worksheet tabs (with exclusions)

Threaded View

  1. #1
    Registered User
    Join Date
    02-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019 / MS365
    Posts
    55

    Sort worksheet tabs (with exclusions)

    I need to group / sort worksheet tabs alphabetically. The one area which I cannot solve is how to group & sort only tab names which include a specific string. The workbooks will have varying numbers of sheet tabs. I need to move all the sheet tabs where the tab name begins with "INV". This string is suffixed with incremental numbers.
    • The sheet tabs which do not contain the text string should be excluded from the sort.
    • There may also be hidden sheets, so the code will need to run only on the visible sheets.

    This is an example of a possible tab order before sorting:
    Tabs Unsorted.bmp

    After running the code, it should be sorted as follows:
    Tabs Sorted.bmp

    The attached workbook contains a code module, but it does not work when sorting only specific tabs and ignoring the others. I plan to include this code in the 'Deactivate' event in the Sheets("Template") module.

    Thank you in advance, for your response.
    Attached Files Attached Files
    Last edited by pinebush; 12-17-2021 at 02:51 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to add new tabs and have sort macros work on new tabs correctly
    By Vicious00013 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-13-2016, 05:43 AM
  2. Macro to sort tabs in a worksheet
    By AnalystMH in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2016, 12:32 PM
  3. [SOLVED] Renaming Worksheet Tabs with Tabs Existing Name + Today's Date
    By longbow007 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-26-2016, 09:51 PM
  4. Replies: 6
    Last Post: 02-01-2012, 05:29 PM
  5. Rename worksheet tabs and sheets to match tabs via button
    By timgavin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-31-2011, 06:12 PM
  6. Sort the Tabs
    By A-Design in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2005, 07:05 PM
  7. [SOLVED] Re-Sort Worksheet tabs
    By Campbti in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-10-2005, 02:06 PM

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