Excel Guides

Displaying the First Worksheet in a Macro in Excel

There are a few different ways that you can display the first worksheet in a macro in Excel. One way is to use the Worksheets property of the Application object. This will return a Sheets collection, which you can then use the Item property to get the first worksheet:

Dim ws As Worksheet
Set ws = Application.Worksheets(1)
ws.Activate

Another way is to use the ActiveWorkbook property of the Application object. This will return a reference to the active workbook, and you can then use the Worksheets property of that workbook to get the first worksheet:

Dim wb As Workbook
Dim ws As Worksheet
Set wb = Application.ActiveWorkbook
Set ws = wb.Worksheets(1)
ws.Activate

Move beyond 

Excel

Get started with Causal today.
Build models effortlessly, connect them directly to your data, and share them with interactive dashboards and beautiful visuals.