Sort Sheets Alphabetically
Reorder every tab in the active workbook A to Z or Z to A in one click
What it does
Tabs in Excel are draggable, which means they end up in whatever order someone last left them. After enough months that's "no order at all". The macro reorders every tab in the active workbook either A to Z or Z to A using a case-insensitive name comparison. It runs in seconds even on workbooks with 50+ sheets and reports the new count when done. No more dragging tabs one at a time.
Real-world example
Picture a controller at a multi-entity holding company. Her main consolidation workbook has 38 tabs: a tab for each of the 12 subsidiaries' P&L, another set of 12 for each subsidiary's balance sheet, plus a handful of summary and check tabs. The tabs are in the order subsidiaries were acquired, which made sense in 2019 when there were six of them and she remembered the founding order. By 2026 she has no idea why "P&L - HoldCo Logistics" sits between "BS - Norfolk" and "P&L - Atlanta Print". Every reconciliation requires a 5-second tab-hunt that adds up to maybe 45 seconds across the dozen tab switches she does per close.
She's tried sorting manually. Drag and drop one tab at a time. With 38 tabs it takes about 4 minutes and she always misplaces two of them. The pain is small enough that she's never invested in fixing it; it just nibbles at her every month.
With this macro she runs the tool, picks 1 for A to Z, and the workbook tabs reorder themselves in 5 seconds. P&L tabs cluster together. BS tabs cluster together. Subsidiary names are alphabetical inside each cluster (because she named her tabs with consistent prefixes like "P&L - Atlanta" and "BS - Atlanta"). Every close after that, she finds the tab she wants on the first try.
On a 38-tab workbook, the macro saves about 4 minutes versus manual reordering, but the bigger win is the workbook stays organized as new tabs get added: re-run the macro after adding a new subsidiary and the alphabetical structure regenerates itself.
How to use
First time? See How to run our tools for the 30-second setup.
- Open the workbook you want to reorder. The macro sorts the active workbook only.
- Press Alt + F8 (Windows) or Option + F8 (Mac), pick
SortSheetsAlphabetically, click Run. - Type 1 for A to Z or 2 for Z to A.
- The macro reorders every tab in the workbook. The popup confirms how many sheets were sorted.
FAQ
Does the sort include hidden sheets?
Yes. Hidden sheets get reordered alongside visible ones. After running, the hidden tabs are still hidden; only the underlying tab order changes. If you specifically want the visible tabs sorted but the hidden ones to stay where they are, you'd need to unhide them, run the macro, then re-hide. The default behavior matches what most people want.
Will it move my "Summary" tab away from position 1?
Yes, that's the trade-off of pure alphabetical sort. "Summary" will land somewhere in the S section, not at the front. If you want a specific tab pinned at position 1, run the macro first, then drag your pinned tab to the front manually. Or rename it with a leading character that sorts to the top, like _Summary (underscore sorts before letters in Excel's StrComp).
What sort rule does it use?
Case-insensitive lexicographic compare via VBA's StrComp with vbTextCompare. So apple and APPLE sort as equal, and Apple comes before Banana regardless of case. Numbers in tab names sort character-by-character (so Tab 10 comes before Tab 2), which is the standard alphabetical-not-natural-numeric behavior. If you need natural numeric sort, rename tabs with zero-padded numbers (Tab 02, Tab 10).
What if I have a tab named purely with a number?
It sorts according to its character value just like any other tab name. So a tab called 2026 sorts before Apple because 2 comes before A in ASCII. A tab named Q1 sorts after 5 and before R. If your tab names are all numbers, consider zero-padding them so the alphabetical sort lines up with what you'd expect numerically.
Can I undo it?
Yes, Ctrl/Cmd + Z right after running undoes all tab moves in one shot. Always work on a copy of the file if its current order is critical. The macro runs entirely offline. Your workbook never leaves your machine.
Did this tool work for you?
One click. We use this to fix tools that don't work and prioritize what to build next.
Related tools
Add Prefix and Suffix to Cells
Bulk-add text to the start and/or end of every cell in your selection, with formulas left untouched
AutoFit All Columns on All Sheets
Run AutoFit on every column of every visible sheet so the workbook is consistently readable in one click
Bulk Add Hyperlinks
Convert every URL-like cell in your selection into a clickable hyperlink in one pass