+ Reply to Thread
Results 1 to 12 of 12

vba to sort multiple sheet tabs in a workbook

  1. #1
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    vba to sort multiple sheet tabs in a workbook

    Hi All

    I have a workbook with multiple sheets .

    Looking for fast vba code to sort sheet names alphabetically.

    Also note some sheets are alpha numeric that is 01_15_ Sodium Peroxide Analysis

    Thanks

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: vba to sort multiple sheet tabs in a workbook

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: vba to sort multiple sheet tabs in a workbook

    Hi JEAN1972,

    Try this Code I saw on Mr. Excel some time ago.)

    Please Login or Register  to view this content.
    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: vba to sort multiple sheet tabs in a workbook

    Another code (I think for Mr. Jbeaucaire)
    Please Login or Register  to view this content.

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: vba to sort multiple sheet tabs in a workbook

    or maybe so
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: vba to sort multiple sheet tabs in a workbook

    Thanks Mr. Nilem for the code
    and may be
    Please Login or Register  to view this content.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: vba to sort multiple sheet tabs in a workbook

    Hello JEAN1972,

    Just for fun. Here is another macro that will sort the worksheets either in ascending (a to z) or descending (z to a) order. This code is a little longer but uses a modified bubble sort which is twice as fast as a normal bubble sort. Doesn't mean much when sorting worksheets but is important when using it to sort lists.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

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

    Re: vba to sort multiple sheet tabs in a workbook

    Quote Originally Posted by JEAN1972 View Post
    Also note some sheets are alpha numeric that is 01_15_ Sodium Peroxide Analysis
    What the other sheet names look like and how do you want sort them?

  9. #9
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: vba to sort multiple sheet tabs in a workbook

    Quote Originally Posted by jindon View Post
    What the other sheet names look like and how do you want sort them?
    Hi Jindon

    Some examples numeric ones first AND alphabetical last like 01_15__sodium peroxide ,beoh_10a27,alphabetical,reports 2015_a_01IE.

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

    Re: vba to sort multiple sheet tabs in a workbook

    Quote Originally Posted by JEAN1972 View Post
    Hi Jindon

    Some examples numeric ones first AND alphabetical last like 01_15__sodium peroxide ,beoh_10a27,alphabetical,reports 2015_a_01IE.
    See if this is how you wanted.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: vba to sort multiple sheet tabs in a workbook

    Quote Originally Posted by Winon View Post
    Hi JEAN1972,

    Try this Code I saw on Mr. Excel some time ago.)

    Please Login or Register  to view this content.
    Regards.
    Hi Winon

    Getting compile error: next without for

    Could you look in

  12. #12
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: vba to sort multiple sheet tabs in a workbook

    Try
    Please Login or Register  to view this content.

+ 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] VBA code to merge multiple sheet with multiple tabs into one workbook in different tabs
    By Jagdev in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-06-2015, 07:42 AM
  2. [SOLVED] Sort workbook Tabs only
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2014, 07:39 AM
  3. Replies: 0
    Last Post: 02-05-2014, 05:18 PM
  4. [SOLVED] Extract data from a workbook with multiple tabs, into a workbook with corresponding tabs
    By krackaberr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 11:54 AM
  5. [SOLVED] Is it possible to sort the tabs in a workbook?
    By Jules in forum Excel General
    Replies: 1
    Last Post: 08-03-2006, 02:55 PM
  6. Can you sort sheet tabs in a workbook
    By Techtrainer in forum Excel General
    Replies: 5
    Last Post: 05-18-2006, 06:15 AM
  7. [SOLVED] selecting multiple sheet tabs and open another workbook
    By Bannor in forum Excel General
    Replies: 5
    Last Post: 11-24-2005, 10:40 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