Home

An Excel Macro to Open Workbooks to a Specific Tab

|
|  Updated:  
2022-01-07 21:29:56
Excel Sales Forecasting For Dummies
Explore Book
Buy On Amazon
In some situations, it's imperative that your Excel workbook be started on a specific worksheet. With this macro, if users are working with your workbook, they can't go astray because the workbook starts on the exact worksheet it needs to.

In the example illustrated here, you want the workbook to go immediately to the sheet called Start Here.

Open the workbook to the Start Here sheet.

Open the workbook to the Start Here sheet.

How the macro works

This macro uses the workbook's Open event to start the workbook on the specified sheet when the workbook is opened:
Private Sub Workbook_Open()
'Step 1: Select the specified sheet
     Sheets("Start Here").Select
End Sub
The macro explicitly names the sheet the workbook should jump to when it's opened.

How to use the macro

To implement this macro, you need to copy and paste it into the Workbook_Open event code window. Placing the macro here allows it to run each time the workbook is opened:
  1. Activate Visual Basic Editor by pressing Alt+F11.

  2. In the project window, find your project/workbook name and click the plus sign next to it to see all the sheets.

  3. Click ThisWorkbook.

  4. In the Event drop-down list, select the Open event.

  5. Type or paste the code in the newly created module, changing the sheet name, if necessary.

    Enter your code in the Workbook Open event.

    Enter your code in the Workbook Open event.

About This Article

This article is from the book: 

About the book author:

Michael Alexander is a senior consultant at Slalom Consulting with more than 15 years’ experience in data management and reporting. He is the author of more than a dozen books on business analysis using Microsoft Excel, and has been named Microsoft Excel MVP for his contributions to the Excel community.