Tab Sorting

BrWolv

New Member
Joined
Jun 18, 2011
Messages
37
Hi,
Would anyone be able to provide me the code to auto sort my Worksheet (Tabs) in Alpha. order? I expect this needs a bit of VBA to accomplish, however, if there is an easier way, pleas advise.

Thanks!!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try this:
Code:
Sub SortABC()
Dim i As Integer, j As Integer, x As Integer
x = Sheets.Count
For i = 1 To x - 1
    For j = i + 1 To x
        If Sheets(j).Name < Sheets(i).Name Then
        Sheets(j).Move before:=Sheets(i)
        End If
    Next
Next
Sheets(1).Select
End Sub
 
Upvote 0
If you're doing this as part of a project then yes, you should be able to find all sorts of code floating around here that sorts sheets.

If it's just for you then you might just download ASAP utilities (if your corp IT dept. will allow it). All sorts of nifty tools in that add-in.
 
Upvote 0
Any chance you could tell me the code to add an Input message to cell A1 on all worksheets in my book, I have over 200 of them, so automation would be wonderful!!

thanks again
 
Upvote 0
This is a new question and as per board rules, really should be asked in a new posting. You've not made it clear what you mean by "input message" so this may not be what you want:
Code:
Sub NameSheets()

Application.ScreenUpdating = False

For i = 1 to Worksheets.Count
  Sheets(i).Range("A1") = "This is sheet number: " & i
Next i

Sheets(1).Select

Application.ScreenUpdating = True

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top