How to sort worksheets in alphabetical order (descending or ascending)?

D

dstdst123

Hi

Am using Excel 2003.
I am using a workbook with various worksheets named differently.

For example, I have the following worksheets in the "tabs" area:

Sheet Kiwi
Sheet Apple
Sheet Orange
Sheet Banana

How can I sort them, so that they appear to me (from left to right)
like:

Sheet Apple
Sheet Banana
Sheet Kiwi
Sheet Orange

Thanks a lot.
 
G

Guest

You could try

Sub liminal_advertisment()
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 Before:=Sheets(I)
End If
Next J
Next I


End Sub

Mike
 
B

Bill Sharpe

Hi

Am using Excel 2003.
I am using a workbook with various worksheets named differently.

For example, I have the following worksheets in the "tabs" area:

Sheet Kiwi
Sheet Apple
Sheet Orange
Sheet Banana

How can I sort them, so that they appear to me (from left to right)
like:

Sheet Apple
Sheet Banana
Sheet Kiwi
Sheet Orange

Thanks a lot.
If you only have four sheets you can just drag the tab names to where
you want them. Otherwise, the macro approach is better.

Bill
 

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