+ Reply to Thread
Results 1 to 6 of 6

Sort Worksheets

  1. #1
    Registered User
    Join Date
    10-07-2011
    Location
    The Great State of Texas
    MS-Off Ver
    Excel 2013
    Posts
    28

    Sort Worksheets

    Not really knowing what I'm doing, I put together this macro to sort worksheets:

    Please Login or Register  to view this content.
    If I have worksheets for example in which the value in B4 is 11-4, 10-2, 3-7, 3-2, 1-9, 1-2, it sorts them as 3-7, 3-2, 11-4, 10-2, 1-9, 1-2 when running the above macro. Close, but not quite there.

    Cell B4, while meant to be a date, is not formatted as a date, and I don't want to mess with that because I've got everything else working smoothly in my own fumbling way. Is there any way to amend the above code so that it recognizes that 11-1 and 10-2 come before the other referenced worksheets? Obviously, I will eventually end up with many more worksheets ... this is just a small example.

    Thanks in advance for your assistance.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Sort Worksheets

    Maybe:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    10-07-2011
    Location
    The Great State of Texas
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Sort Worksheets

    xladept:

    Thanks for your response.

    When running the code, this line is highlighted:

    Please Login or Register  to view this content.
    Any suggestions? Thanks in advance for your help.

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

    Re: Sort Worksheets

    Quote Originally Posted by madaboutgolf View Post

    Cell B4, while meant to be a date, is not formatted as a date, and I don't want to mess with that because I've got everything else working smoothly in my own fumbling way. Is there any way to amend the above code so that it recognizes that 11-1 and 10-2 come before the other referenced worksheets? Obviously, I will eventually end up with many more worksheets ... this is just a small example.

    Thanks in advance for your assistance.
    Try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-07-2011
    Location
    The Great State of Texas
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Sort Worksheets

    jindon and xladept,

    Perfect ... thank you for your assistance!

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Sort Worksheets

    You're welcome and thanks for the rep!

+ 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 Help to Sort Worksheets
    By markharris2004 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-06-2014, 04:27 PM
  2. sort worksheets alphabetically and keep the data in the worksheets
    By Cynthia Woods in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-15-2013, 12:38 PM
  3. Sort all Worksheets
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2010, 09:41 AM
  4. Replies: 2
    Last Post: 02-01-2006, 02:15 PM
  5. [SOLVED] How do I sort Worksheets by name?
    By M Skabialka in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 04-07-2005, 02:06 PM
  6. [SOLVED] Sort Worksheets
    By mate in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-24-2005, 07:06 AM
  7. [SOLVED] Sorting Worksheets-is it possible to sort worksheets alphabetically?
    By pepperds in forum Excel General
    Replies: 1
    Last Post: 03-10-2005, 05: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