Alphabatizing my worksheets
This is a very primitive one. But try it.
Sub sortsheetname()
Dim n As Long, i As Long
For n = Worksheets.Count To 1 Step -1
For i = 2 To n - 1
If Worksheets(i).Name Worksheets(i + 1).Name Then
Worksheets(i).Move after:=Worksheets(i + 1)
End If
Next
Next
End Sub
Keiji
John wrote:
What code might I use to sort all the worksheets except the master summary
sheet into alphabetic order? (The master summary sheet's tab name is unique
and I want it to always be the first tab in the workbook.)
|