Is there a way to put worksheets in alphabetical sequence?

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.
 
M

Mike H

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
 

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