Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting sheets in workbook Jeff Excel Programming 7 March 9th 06 10:55 PM
Sorting Sheets in a Workbook Mnj 78 Excel Programming 2 October 12th 04 06:39 PM
Sorting sheets in Workbook Mnj 78[_2_] Excel Programming 2 October 12th 04 05:41 PM
Sorting Sheets in a workbook Mnj 78[_2_] Excel Programming 1 October 12th 04 05:26 PM
Sorting Sheets in Workbook Mnj 78[_2_] Excel Programming 1 October 12th 04 05:26 PM


All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"