Is there a way to put worksheets in alphabetical sequence?

  • Thread starter Thread starter CH
  • Start date Start date
C

CH

I have a group of procedures costs that I am entering into excel as I work
them up. Each worksheet bears the name of the procedure. I would like to be
able to alphabetize the worksheets.
 
Hi,

Right click any worksheet tab, view code and paste the code below in and run
it

Sub Sortem()
For X = 1 To Worksheets.Count
For y = X To Worksheets.Count
If UCase(Sheets(y).Name) < UCase(Sheets(X).Name) Then
Sheets(y).Move Before:=Sheets(X)
End If
Next
Next
End Sub

Mike
 
Back
Top