Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Gives indexes of sheets

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