Index Property

Applies To

Chart object, ChartGroup object, ChartObject object, LegendEntry object, Name object, OLEObject object, Pane object, PivotCache object, PivotFormula object, RecentFile object, Scenario object, Trendline object, Window object, Worksheet object.

Description

Returns the index number of the object within the collection of similar objects. Read-only Long.

Example

This example displays the tab number of the sheet name that you type. For example, if Chart1 is the third tab in the active workbook, the example displays "3" in a message box.

sheetname = InputBox("Type a sheet name, such as Sheet12")
MsgBox "This sheet is tab number " & Sheets(sheetname).Index