# Sorting Excel Tabs in Alpha Numerical Order

#### Peppertaker

##### New Member
Need help in sorting my tabs in Alpha Numerical order. I have the following tabs in my workbook... "All Info, Totals By District, Totals by VPN, District 1, District 2, etc up to District 13. When I use the code below it sorts tabs alphabetically, but it list the Districts in order of 1, 10, 11, 12, 13. Can someone please help alter this macro to sort the tabs so Districts 10, 11, 12, 13 actually come after the District 9 tab?

Sub Sortem()
Dim x As Long, y As Long
For x = 1 To Worksheets.Count
For y = x To Worksheets.Count
If UCase(Sheets.Name) < UCase(Sheets(x).Name) Then
Sheets.Move before:=Sheets(x)
End If
Next
Next
End Sub

Thanks.

### Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

#### Peppertaker

##### New Member
I've viewed this link but it doesn't sort the way I need it to. It still sorts my districts as 1, 10, 11, 12, 13, 2, 3, ,4 etc.

#### hiker95

##### Well-known Member
Peppertaker,

There is a lot of good information on the web if you search for:

Sorting Excel Tabs in Alpha Numerical Order

If you still can not find a solution, then:

Click on the Reply to Thread button, and just put the word BUMP in the thread. Then, click on the Post Quick Reply button, and someone else will assist you.

#### hiker95

##### Well-known Member
Peppertaker,

There are a lot of examples on MrExcel.

In the upper right hand corner of the MrExcel banner page, click on Advanced Search

On the page that opens:

In the box to the right of Keyword(s): enter "Sort Sheets" with the " characters.

And, click on the Search Now button.

#### 63falcondude

##### Well-known Member
Out of curiosity does it work for you if you change District 9 to District 09, District 4 to District 04, etc?

#### Peppertaker

##### New Member
Yes 63falcondude -that did work changing the District to 01, 02, 03 etc. Thanks.

Solved!!

Replies
3
Views
228
Replies
2
Views
315
Replies
2
Views
205
Replies
5
Views
270
Replies
0
Views
156

1,190,865
Messages
5,983,286
Members
439,836
Latest member
BuckyBoyRx

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back