#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Excel worksheets

I wonder if there is a quick way to put the sheets within a workbook into
numerical/alphabetical order.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default Excel worksheets

Macro is the only quick way

http://www.cpearson.com/excel/sortws.aspx

on how to install macros

http://www.mvps.org/dmcritchie/excel/install.htm

--


Regards,


Peo Sjoblom

"lorwoman" wrote in message
...
I wonder if there is a quick way to put the sheets within a workbook into
numerical/alphabetical order.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,365
Default Excel worksheets

An internet search for "sort excel worksheets' turns up several sites
offering solutioins. One of those is the Ozgrid site, a good source, which
published this code:

Sub SortSheets()
Dim lCount As Long, lCounted As Long
Dim lShtLast As Long
Dim lReply As Long

lReply = MsgBox("To sort Worksheets ascending, select 'Yes'. " _
& "To sort Worksheets descending select 'No'", vbYesNoCancel, "Ozgrid Sheet
Sort")

If lReply = vbCancel Then Exit Sub
lShtLast = Sheets.Count
If lReply = vbYes Then 'Sort ascending
For lCount = 1 To lShtLast
For lCount2 = lCount To lShtLast
If UCase(Sheets(lCount2).Name) < UCase(Sheets(lCount).Name)
Then
Sheets(lCount2).Move Befo=Sheets(lCount)
End If
Next lCount2
Next lCount
Else 'Sort descending
For lCount = 1 To lShtLast
For lCount2 = lCount To lShtLast
If UCase(Sheets(lCount2).Name) UCase(Sheets(lCount).Name)
Then
Sheets(lCount2).Move Befo=Sheets(lCount)
End If
Next lCount2
Next lCount
End If

End Sub

To put the code into your workbook, press [Alt]+[F11] to enter the VB Editor
and then choose Insert | Module and copy and paste the code above into the
module presented to you, close the VB Editor and run the code from Tools |
Macro | Macros.

Chip Pearson also has a good solution (one I've borrowed myself in the past)
at his site on this page: http://www.cpearson.com/Excel/sortws.aspx


"lorwoman" wrote:

I wonder if there is a quick way to put the sheets within a workbook into
numerical/alphabetical order.

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
Unable to save modified Excel 2003 worksheets using Excel 2007 vkeller Excel Discussion (Misc queries) 0 May 9th 08 10:38 PM
How use info in Excel shared worksheets to create new worksheets dkc Excel Worksheet Functions 0 June 28th 07 08:36 PM
How do i assign the ActiveWorkbook.Worksheets to a worksheets object? TS Excel Worksheet Functions 2 December 27th 06 02:49 PM
Weird problem with Excel 2000...Worksheets disappearing in a shared Excel file BrianL_SF Excel Discussion (Misc queries) 2 October 10th 06 08:27 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM


All times are GMT +1. The time now is 03:51 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"