Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sorting Worksheets in Excel 97

2 views
Skip to first unread message

Gordon Burgess-Parker

unread,
Mar 8, 2002, 11:14:14 AM3/8/02
to
Is there any way of sorting Worksheets in Excel 97 (alphabetically say)
other than by manually dragging them?

Thanks

Gordon


--
Mandrake 8.0 User at Home since 8 October 2001 :-)
Registered Linux User no 240308
Windows 2000 Pro user at Work :-(


David McRitchie

unread,
Mar 8, 2002, 11:47:00 AM3/8/02
to
Hi Gordon,
You need a macro, see getstarted.htm if you need help
installing a macro, the code for such a macro as seen in both buildtoc.htm and buildtoc2.htm

Sub SortALLSheets()
'modification of coded example by Bill Manville
Dim iSheet As Integer, iBefore As Integer
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 Before:=ActiveWorkbook.Sheets(iBefore)
Exit For
End If
Next iBefore
Next iSheet
End Sub '-- SortALLSheets()

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Macros: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm


"Gordon Burgess-Parker" <gordon.burges...@ntlworld.com> wrote in message news:a6anpg$d0u6c$2...@ID-108938.news.dfncis.de...

Ray

unread,
Mar 8, 2002, 12:42:28 PM3/8/02
to
When you name the spreadsheets use a numerical,
alphabetical, or a combined numerical and alphabetical
code in the first part of the name and it will sort them
as you specify. EX) A1-(rest of name),A2-(rest of name),
etc. OR, put the spreadsheets into categorized folders.
In a window,Excel puts folders first (top of list of
speadsheets), alphabetized by the first letter of the name
of the folders.

>.
>

0 new messages