Article ID: 105069
Article Last Modified on 1/18/2007
Sub Sort_Active_Book()
Dim i As Integer, j As Integer
For i = 1 To Sheets.Count
For j = 1 To Sheets.Count - 1
If UCase$(Sheets(j).Name) > UCase$(Sheets(j + 1).Name) Then
Sheets(j).Move After:=Sheets(j + 1)
End If
Next j
Next i
End Sub
NOTE: If you want to sort the tabs in descending order instead of ascending
order, change the greater than sign (>) to a less than sign (<) in the
following line:
If UCase$(Sheets(j).Name) > UCase$(Sheets(j + 1).Name) Thenso that it resembles this line:
If UCase$(Sheets(j).Name) < UCase$(Sheets(j + 1).Name) ThenTo use the macro, follow these steps:
Additional query words: 5.00c 8.00 XL98 XL97 XL7 XL5 worksheet tab how to sheet
Keywords: kbdtacode kbhowto kbprogramming KB105069