Counting and Selecting Worksheets:   Return to List

Public Sub Main()
For i = 1 To Sheets.Count' Provides a count of all worksheets
    If TypeName(Sheets(i)) = "Worksheet" Then' Gives the type of worksheet
        Sheets(i).Name' Provides the name for the worksheet
        Sheets(i).Select' Selects the particular worksheet
    End If
Next
End Sub

See also:
Activate Worksheet by Name
Activates the First Worksheet
Activates Last Worksheet
Adding a Worksheet
Copying one worksheet to another
Deletes Active Worksheet (no save)
Moving worksheet to particular location (i.e., order)
Naming the active worksheet



Note to Webmaster