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.
Written by Allen Wyatt (last updated November 1, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003
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:
Now, whenever you open the workbook, the specified worksheet will be displayed.
Note:
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.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
Changing the color used on a worksheet tab is easy. Just follow the three steps in this tip.
Discover MoreA large number of graphics in a worksheet can slow down Excel. One way to compensate is to turn on picture placeholders, ...
Discover MoreWhen you press Enter while adding information to a worksheet, Excel normally drops to the next cell down in the column. ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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
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
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
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".
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments