excel+vba+training - arranging sheets alphabetically
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel Training and help » excel+vba+training - Arranging sheets alphabetically

excel+vba+training - Arranging sheets alphabetically

resolvedResolved · Low Priority · Version Standard

replyReply Wed 24 Oct 2007, 11:15Delegate Heidi Doan said...

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.

For upcoming training course dates see: Pricing & availability

replyReply Wed 24 Oct 2007, 12:20Trainer Carlos said...

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

 

Excel tip:

Change the default location for opening and saving spreadsheets

If you are always opening spreadsheets from and/or saving documents to a specific location that is not My Documents, save time by setting this folder as the default for opening files from and saving files to.

Here's how:
1. Go to Tools - Options.

2. Select the General tab.

3. Enter the pathname of the folder you wish to make the default in the Default File Location box (hint: it will be easier to use Windows Explorer to navigate to this folder, then copy and paste the pathname from the address bar at the top of the Windows Explorer screen).

4. Click OK.

You have now changed the default folder for opening and saving spreadsheets.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard