View Single Post
  #2   Report Post  
Gary L Brown
 
Posts: n/a
Default

'/=================================================/
Sub WkshtSort_Ascending()
Dim i As Integer, x As Integer
Dim iWksheetCount As Integer

iWksheetCount = Application.ActiveWorkbook.Worksheets.Count

For i = 1 To iWksheetCount
For x = i To iWksheetCount
If UCase(Worksheets(x).Name) < _
UCase(Worksheets(i).Name) Then
Worksheets(x).Move Befo=Worksheets(i)
End If
Next x
Next i

End Sub
'/=================================================/
Sub WkshtSort_Descending()
Dim i As Integer, x As Integer
Dim iWksheetCount As Integer

iWksheetCount = Application.ActiveWorkbook.Worksheets.Count

For i = 1 To iWksheetCount
For x = i To iWksheetCount
If UCase(Worksheets(x).Name) _
UCase(Worksheets(i).Name) Then
Worksheets(x).Move Befo=Worksheets(i)
End If
Next x
Next i

End Sub
'/=================================================/

HTH,
--
Gary Brown

If this post was helpful, please click the ''''Yes'''' button next to
''''Was this Post Helpfull to you?".


"Nick" wrote:

How do I sort worksheets in excel? i.e. if i had multiple worksheets in a
workbook each containing a date, how could i sort the worksheets into date
order?