Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Excel worksheets
I wonder if there is a quick way to put the sheets within a workbook into
numerical/alphabetical order. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to save modified Excel 2003 worksheets using Excel 2007 | Excel Discussion (Misc queries) | |||
How use info in Excel shared worksheets to create new worksheets | Excel Worksheet Functions | |||
How do i assign the ActiveWorkbook.Worksheets to a worksheets object? | Excel Worksheet Functions | |||
Weird problem with Excel 2000...Worksheets disappearing in a shared Excel file | Excel Discussion (Misc queries) | |||
Assigning Cells in worksheets to other data in other worksheets. | Excel Discussion (Misc queries) |