Code:
Sub SortALLSheets() 'This module will sort all the worksheets present in active workbook.
Dim iSheet As Long, iBefore As LongFor iSheet = 1 To ActiveWorkbook.Sheets.count
Sheets(iSheet).Visible = True
For iBefore = 1 To iSheet - 1
If UCase(Sheets(iBefore).Name) > UCase(Sheets(iSheet).Name) Then
ActiveWorkbook.Sheets(iSheet).Move before:=ActiveWorkbook.Sheets(iBefore)
Exit For
End If
Next iBeforeNext iSheet
End Sub
Comments