Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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? |
#2
![]() |
|||
|
|||
![]()
'/=================================================/
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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I sort letters before numbers in Excel? | Excel Discussion (Misc queries) | |||
Sort Ascending button - Excel 2003 | Excel Discussion (Misc queries) | |||
How do I activate sort in Excel? | Excel Discussion (Misc queries) | |||
How do I activate sort in Excel? | Excel Discussion (Misc queries) | |||
How do I activate sort in Excel? | Excel Discussion (Misc queries) |