View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Can you sort sheet tabs in a workbook

try

Sub SortALLSheetsbyName() 'McRitchie
'sort sheets within a workbook in Excel 7 -- Bill Manville
'modified to sort all sheets instead of just worksheets
Dim iSheet As Integer, iBefore As Integer
For 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
Befo=ActiveWorkbook.Sheets(iBefore)
Exit For
End If
Next iBefore
Next iSheet
End Sub

--
Don Guillett
SalesAid Software

"Techtrainer" wrote in message
...
How can I sort the sheet tabs in my workbook