The Sheets Collection : Worksheets « Excel « VBA / Excel / Access / Word






The Sheets Collection

 
     Sub WorksheetIndex()
           Dim i As Integer

           For i = 1 To ThisWorkbook.Worksheets.Count
           MsgBox ThisWorkbook.Worksheets(i).name & _
                 " has Index = " & _
                 ThisWorkbook.Worksheets(i).Index
           Next i
     End Sub

 








Related examples in the same category

1.Do... Loop Until Loops with Worksheets
2.Looping Through Worksheets in a Workbook
3.move the second worksheet to end of workbook
4.performs a simple bubble sort to sort the worksheets in the workbook
5.For...Next Loop with Worksheet
6.Grouping Worksheets
7.Dynamic Arrays for worksheet name
8.Use for loop to loop through all worksheets
9.Sort all worksheets