Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Default Worksheet when Opening.

Default Worksheet when Opening

Written by Allen Wyatt (last updated November 1, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


13

When you open a workbook, Excel normally displays the worksheet last displayed when the workbook was last saved. You may want a specific worksheet to always be displayed when the workbook is opened, regardless of the worksheet displayed when the workbook was last saved.

You can control which worksheet is displayed by using this macro:

Private Sub Workbook_Open()
    Worksheets("StartSheet").Activate
End Sub

This macro will always display a worksheet named StartSheet. You will obviously need to change the worksheet name to something different; it should exactly match the name of the desired worksheet.

For this macro to work properly, it has to be associated with the workbook object. Follow these steps:

  1. Make sure you have only a single Excel workbook open. While this isn't exactly mandatory, it will make creating the macro a bit easier.
  2. Press Alt+F11 to display the VBA Editor.
  3. In the Project Explorer window you will see a list of the open workbooks and templates. If the Project Explorer is not visible on your screen, choose Project Explorer from the View menu.
  4. Locate your current workbook in the Project Explorer. It will be named something like VBAProject (MyWorkbook), where "MyWorkbook" is the name of the actual workbook.
  5. If there is a plus sign to the left of the current workbook in the Project Explorer, click on it. You should see a list of worksheets appear underneath the workbook.
  6. If you don't see a list of worksheets, but instead see a list of folders with plus signs to their left, click on the plus sign to the left of Microsoft Excel Objects. Now you should see the worksheets.
  7. At the bottom of the list of worksheets is the ThisWorkbook object. Double-click on it. A code window is opened.
  8. In the code window, paste or create the macro shown above. Make sure you name it exactly as shown.
  9. Close the VBA Editor.
  10. Save your workbook.

Now, whenever you open the workbook, the specified worksheet will be displayed.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2014) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Default Worksheet when Opening.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Extracting a State and a ZIP Code

Excel is often used to process or edit data in some way. For example, you may have a bunch of addresses from which you ...

Discover More

Counting Fields in a Document

Need to count the number of times a particular field appears in a document? It's easy to do when you apply the techniques ...

Discover More

Adding Caption Labels

When using the captioning capabilities of Word, you aren't limited to the three default caption labels provided in the ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (menu)

Colors and Fonts for Worksheet Tabs

Changing the color used on a worksheet tab is easy. Just follow the three steps in this tip.

Discover More

Changing Gridline Color

Gridlines are very helpful in seeing where cells are located on the screen. You are not limited to black gridlines; ...

Discover More

Controlling Display of the Formula Bar

The Formula Bar is a regularly used feature in the Excel interface. You can, however, modify whether Excel displays the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five more than 0?

2023-05-24 06:10:20

Alvin

You say that "Excel normally displays the worksheet last displayed when the workbook was last saved".. This is NOT TRUE and this is my problem. Why can't it display the sheet that was last saved when I open the file!?


2021-03-30 12:49:28

Rebekah

The example does not work as written.

Private Sub Workbook_Open()
Worksheets("StartSheet").Activate
End Sub

This worked for me:

\Private Sub Workbook_Open()
Sheets("Start Sheet").Select
End Sub


2020-02-27 14:20:29

Hurryjet

These instructions were extremely helpful! Thanks much for providing them! I will mention that one needs to make sure that one is working on a file that is of a "macro enabled" type. I didn't realize that the version of Excel that I was using wouldn't allowed macros until I tried to save the file with the added macro. It wouldn't save the macro. So I first had to save the file as a macro-enabled type and then add the macro. It worked perfectly!


2019-10-25 03:52:46

Juhani

Hi, For the advice at June 25, 2018, "Default worksheet when opening": If you want to always go to a specific work sheet when you open excel workbook, for sure a macro with sheet.activate works. BUT...in many (most?) organizations, for security reasons, all office tools, including excel, open with macros disabled. And, nowadays in the MS Office 365 environment the Excel workbooks don't open event into the native Excel desktop app but into the browser Excel extension where macros, and many other advanced features, don't work. Therefore it would be a good addition from MS to add an property/attribute for the Workbook object: "DefaultOpeningWorksheet".


2018-11-02 03:07:13

Alan Elston

Hallo again Heidi
Just to quote Allen Wyatt:--....."..You will obviously need to change the worksheet name to something different; it should exactly match the name of the desired worksheet...."....


2018-11-02 03:04:04

Alan Elston

Hello Heidi
Usually that error means that you don’t have a Worksheet with the tab name that you are trying to use in this part of the code: (“ “). If you are using the code exactly as Allen has given it , then you must have a tab name of "StartSheet". Usually , if you are using a normal/ default workbook in an English version of Excel, then the code line that you usually need would be for the first sheet:
Worksheets("Sheet1").Activate
and for the second sheet the code line would usually be:
Worksheets("Sheet2").Activate
As an alternative, you can refer to a worksheet item by its index number ( The index number is an integer counting the tabs as you see them from the left. So, for example, the first worksheet tab from the left has index number 1 ). So for example, to refer to the second sheet, an alternative code line would be
Worksheets.Item(2).Activate

Alan Elston


2018-11-01 16:09:56

Heidi

Getting a run-time error 9
Subscript out of range


2018-09-14 05:29:11

Manish Maurya

It is not working, It says
Activate method of Worksheet Class Failed


2018-02-01 11:08:26

Willy Vanhaelen

@Mark
Perhaps you use
Private Sub Workbook_Activate()
istead of
Private Sub Workbook_Open()


2018-01-31 08:46:20

Mark Arnold

Allen

Thank You for all you do. This is something I use all the time but just came across an anomoly. I have the macro so that my file opens on the page that I want , but if I go temporarily to use a different excel spreadsheet and then return to the one with the code it goes back to the initial opening window rather than stay on the page I was on, even though the worksheet was already open. is there any way I can stop this from happening.

Thanks


2017-12-20 14:37:37

Megan Smith

Doesn't seem to work for 2013?


2017-09-09 08:24:36

Frank Natalia

Most helpful. I would add that after adding Macro you have to save your Workbook in a Macro-Enabled format. (Save as)


2017-08-19 12:21:46

Robert Matthews

Worked great - thanks! Might be worth saying at point 8

"In the code window, paste or create the macro shown above. Make sure you use exactly the format shown - including the quote marks - around the sheet name you want to open with".


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.