Thread: Sort Worksheets
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Sort Worksheets

Quick and dirty sort by name.

Sub sort_sheets()
'Mike H June 13th, 2007
Dim I As Integer, J As Integer

For I = 1 To Sheets.Count - 1
For J = I + 1 To Sheets.Count
If UCase(Sheets(I).Name) UCase(Sheets(J).Name) Then
Sheets(J).Move Befo=Sheets(I)
End If
Next J
Next I
End Sub

For more methods and flexibility see Chip pearson's site.

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


Gord Dibben MS Excel MVP

On Sat, 23 Feb 2008 17:25:08 -0800, "Patrick C. Simonds"
wrote:

Is there any way (using VBA code) to place all WorkSheets in a WorkBook in
alphabetical order?