Refer to Sheets by Name
You can identify sheets by name using the Worksheets and Charts properties. The following statements activate various sheets in the active workbook.
Worksheets("Sheet1").Activate
Charts("Chart1").Activate
DialogSheets("Dialog1").Activate
Use the Sheets property to return a worksheet, chart, module, or dialog sheet. The Sheets collection contains all of these kinds of sheets. The following example activates the sheet named "Chart1" in the active workbook.
Sub ActivateChart()
Sheets("Chart1").Activate
End Sub
Note Charts embedded in a worksheet are members of the ChartObjects collection, whereas charts that exist on their own sheets belong to the Charts collection.
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for