+ Reply to Thread
Results 1 to 10 of 10

Sort worksheets by date (MMM YYYY)

  1. #1
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Sort worksheets by date (MMM YYYY)

    I have several worksheets labelled in the mmm yyyy format and this is an ever expanding project, with macros creating new sheets in the distant future, but the creation of these sheets puts the order out of sync.

    Is there any way to sort worksheets that have this format mmm yyyy, I can see plenty of macros for alphabetical sorting but not this way.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Sort worksheets by date (MMM YYYY)

    hi nickmax1, please check attachment, option to make such sorting. As you have not provided any sample file of yours it may some tweaking for a different file.
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Sort worksheets by date (MMM YYYY)

    As per usual you pull through, how would you amend the code if you had two worksheets called "Graphs" and "Start" that would not be included in your sorting?

    Or failing that, what would my "Graphs" and "Start" be renamed to to ensure they are always the tab to the far right (as opposed to the far left)

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Sort worksheets by date (MMM YYYY)

    please check attachment
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Sort worksheets by date (MMM YYYY)

    wow it works perfectly....i have been a massive pain in your backside already but any chance you could explain how your code works? Specifically how you got "graphs" and "start" to stay to the left.
    IE if i wanted them to the far right of my worksheets how would i change things>?

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Sort worksheets by date (MMM YYYY)

    Graphs and Start sheets to the far right position, please check attachment (assuming it should be Graphs, Start, ...)

    The code takes all sheet names except Start and Graphs, creates new sheet, pastes data their in number format and text format, does sorting by the first column in numbering format, takes sorted text values and repositions the sheets.

    This line allows to omit Graphs and Start sheets:

    Please Login or Register  to view this content.
    Details are available in VB help file, search string: InStr
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Sort worksheets by date (MMM YYYY)

    Awesome - solved - thanks!

  8. #8
    Registered User
    Join Date
    10-10-2013
    Location
    uk
    MS-Off Ver
    Excel 2013
    Posts
    25

    Question Re: Sort worksheets by date (MMM YYYY)

    i need to sort worksheets by the following date format dd.mm.yy. How can i tweak the macro to sort by this format?

    Also, if after sorting, i have inadvertently moved worksheets around and need to re-sort them, how do I action this?

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Sort worksheets by date (MMM YYYY)

    surfing69

    You have to start your own thread as per forum rules.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  10. #10
    Registered User
    Join Date
    10-10-2013
    Location
    uk
    MS-Off Ver
    Excel 2013
    Posts
    25

    Re: Sort worksheets by date (MMM YYYY)

    thanks - will do.

+ 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