Sort Page Tabs into Alphabetical Order ? ?

D

Dodge Brown

Hi All



Just a quick one, is there anyway to sor Excel Pages into alphabetical order
?



Any Suggestons would be great

Dodge
 
K

Ken Wright

From a previous posting:-

http://groups.google.com/advanced_group_search?hl=en

http://www.rondebruin.nl/Google.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()
 
K

Ken Wright

Damn wordwrap - The line starting 'Before:=ActiveWorkbook.Sheets(iBefore)' is
actually a part of the previous line after the word 'Move'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top