How do i sort SEPARATE excel worksheets in order by date?

lacey atkinson 0 Reputation points
2025-05-06T12:53:09.0433333+00:00

I've tried simple googe searches that keep leading me back to how to sort dates within a singular spreadsheet. I've also come across a bunch of macros I don't know how to use and wasn't sure how to trouble shoot. Is there an easier way to copy and paste a code for a macro that i wont have such a hard time troubleshooting? If it makes a difference they are only monthly but there is about 8 years of monthly sheets so I'm really trying to avoid doing it manually.

Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,909 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Barry Schwarz 3,746 Reputation points
    2025-05-07T20:21:52.1933333+00:00

    Given the lack of detail in your post, this solution will be somewhat generic.

    The Worksheets collection will allow you to process as many worksheets as you wish. Using the For Each statement, build an array of worksheet names. If the name does not already contain the appropriate date information, modify the name in the array with that data (probably extracted from the worksheet itself).

    Sort the array in descending order.

    Loop through the array in order. For each name, execute a statement of the form

    Worksheets("name").move before:=worksheets(1)

    If you had to adjust the name to include date information, re-adjust the name back to its original form before executing the move.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.