98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » excel+vba+training - Arranging sheets alphabetically
excel+vba+training - Arranging sheets alphabetically
Resolved · Low Priority · Version Standard
Heidi Doan has attended:
Word Advanced course
Excel Advanced course
Access Introduction course
Outlook Advanced course
Arranging sheets alphabetically
Hi, how do I arrange all the sheets in a workbook alphabetically? Thanks.
RE: Arranging sheets alphabetically
Heidi
Excel doesn't provide a feature that sorts a workbook's sheets alphabetically by sheet name.
However, you can use the simple procedure below. To do this:
1. Press Alt + F8 to display Excel's Macro dialog box
2. In the Macro Name window type in AlphaSheet (Or any other macro name you wish)
3. Click the Create button
The Visual Basic Editor appears, open at a new module sheet already containing the beginning and ending statements in the procedure.
Fill in the rest of the code or copy the middle part of the procedure below and paste it into the code window so as to complete the procedure
Sub AlphaSheet()
Dim Count As Integer
Dim i As Integer
Dim j As Integer
Application.ScreenUpdating = False
Count = Sheets.Count
For i = 1 To Count - 1
For j = i + 1 To Count
If Sheets(j).Name < Sheets(i).Name Then
Sheets(j).Move Before:=Sheets(i)
End If
Next
Next
End Sub
Close the Visual Basic Editor and return to Excel. To run the procedure:
1. Press Alt + F8 to display Excel's Macro dialog box
2. Choose AlphaSheet from the list of macro names
3. Click OK.
This will arrange the sheets alphabetically.
Carlos
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Hiding and unhiding columns using the keyboardCTRL + 0 hides your columns and CTRL + SHIFT + ) unhides them although you would need to highlight the column letters either side as per normal |