Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting the sheets in a workbook ?
Is there a way to sort the sheets in a workbook to have them in alphabetical
order....other than manually moving them ? Hoping for a "yes" answer.....and thanks ! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting the sheets in a workbook ?
David McRitchie's site has this macro to sort the sheets in a workbook:
Sub SortALLSheets() 'sort sheets within a workbook in Excel 7 -- Bill Manville 'modified to sort all sheets instead of just worksheets Dim iSheet As Long, iBefore As Long 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 His site is located at: http://www.mvps.org/dmcritchie/excel...#sortallsheets Hope this helps, Hutch "Eric_in_EVV" wrote: Is there a way to sort the sheets in a workbook to have them in alphabetical order....other than manually moving them ? Hoping for a "yes" answer.....and thanks ! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting the sheets in a workbook ?
I really was expecting the answer to be "no way can that be done"....so I'm
thrilled to see yuor reply. I'm going to copy the code below and check it out...will also visit David McRitchie's site ! How Sweet it is !! Thanks !! "Tom Hutchins" wrote: David McRitchie's site has this macro to sort the sheets in a workbook: Sub SortALLSheets() 'sort sheets within a workbook in Excel 7 -- Bill Manville 'modified to sort all sheets instead of just worksheets Dim iSheet As Long, iBefore As Long 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 His site is located at: http://www.mvps.org/dmcritchie/excel...#sortallsheets Hope this helps, Hutch "Eric_in_EVV" wrote: Is there a way to sort the sheets in a workbook to have them in alphabetical order....other than manually moving them ? Hoping for a "yes" answer.....and thanks ! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting sheets in workbook | Excel Programming | |||
Sorting Sheets in a Workbook | Excel Programming | |||
Sorting sheets in Workbook | Excel Programming | |||
Sorting Sheets in a workbook | Excel Programming | |||
Sorting Sheets in Workbook | Excel Programming |