Sort Worksheet Names?

  • Thread starter Thread starter Stan
  • Start date Start date
S

Stan

Is there any way to sort worksheet names?
Win XP Pro
Office 2003 & 2007
 
Sub SortArk()
Dim sh()
ReDim sh(Sheets.Count)
Application.ScreenUpdating = False

For t = 1 To Sheets.Count
sh(t) = Sheets(t).Name
Next

For t = 1 To Sheets.Count
For tt = t To Sheets.Count
If sh(t) > sh(tt) Then x = sh(t): sh(t) = sh(tt): sh(tt) = x
Next
Next

For t = 1 To Sheets.Count
Sheets(sh(t)).Move after:=Sheets(Sheets.Count)
Next

Application.ScreenUpdating = True
End Sub



"Stan" skrev:
 
Thank you!
I am a complete newby!
How and where do I enter all that?
Perhaps there's a tutorial somewhere on the internet to assist me?
 
in your sheet hit ALT+F11
select module in Insert-menu
paste code here
return to sheet
hit ALT+F8
select macro at hit run


"Stan" skrev:
 

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

Back
Top