Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '
- ' Alt+F11, Insert > Module, paste, hit F5 (instructions from https://www.extendoffice.com/documents/excel/629-excel-sort-sheets.html)
- ' Code from https://learn.microsoft.com/en-us/office/vba/excel/concepts/workbooks-and-worksheets/sort-worksheets-alphanumerically-by-name
- '
- Sub SortSheetsTabName()
- Application.ScreenUpdating = False
- Dim iSheets%, i%, j%
- iSheets = Sheets.Count
- For i = 1 To iSheets - 1
- For j = i + 1 To iSheets
- If Sheets(j).Name < Sheets(i).Name Then
- Sheets(j).Move before:=Sheets(i)
- End If
- Next j
- Next i
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement