Index Property 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