Marcus wonders if it is possible to somehow configure a workbook so that it opens on the same worksheet tab each time it is opened, rather than on the worksheet tab that was displayed when the workbook was last saved. The short answer is that you can do this—provided you use a macro. (There is no way to do it without a macro.)
There are two ways you can set up your macro. First, you can use a traditional Auto_Open macro that is automatically run whenever a workbook is opened:
Sub Auto_Open() Sheets("OpenToThisSheet").Select End Sub
All you need to do is replace OpenToThisSheet with the name of the worksheet you want displayed when the workbook opens. A similar approach is to create a Workbook_Open event handler:
Sub Workbook_Open() ActiveWorkbook.Sheets("OpenToThisSheet").Activate End Sub
Again, change the sheet name to reflect the name of the actual sheet you want displayed. This event handler should be added as part of the ThisWorkbook module.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11706) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Opening a Workbook to a Specific Worksheet.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
Excel has the capability to automatically open workbooks when you first start the program. You may not want to have one ...
Discover MoreExcel allows you to easily make changes to the ribbon, as well as to the Quick Access Toolbar, which is near the ribbon. ...
Discover MoreIf your worksheet is linked to data in other worksheets, you may need to change the link from time to time. Here's how to ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2019-07-19 06:57:55
Mike
Selecting the sheet before saving the workbook will probably make this work, even with macros disabled when the workbook is opened.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("OpenToThisSheet").Activate
End Sub
2019-07-18 06:37:40
Martyn Crawford
Hi Allen
Perfect timing! I have a situation just today where I need to do exactly what this Tip talks about.
Thank you!
2015-12-15 05:52:38
Barry
This ONLY works if the security settings for your installation of Excel allow macros to run, or if macros are not disabled when the Workbook is opened.
There is no easy way around this but you could have a macro that hides all the Worksheets whenever the Workbook is closed/saved forcing the User to allow macros to be run in order to access any Worksheets in the Workbook.
2015-12-14 10:56:38
StevenM
This can also be accomplished by saving a workspace (VIEW tab, Save Workspace)and opening the *.xlw file instead of opening the spreadsheet directly.
2015-12-12 08:31:42
Willy Vanhaelen
The Auto_Open macro is a relic of old Excel versions. This is what Help (Excel 2007) says:
"Workbook.RunAutoMacros Method
Runs the Auto_Open, Auto_Close, Auto_Activate, or Auto_Deactivate macro attached to the workbook. This method is included for backward compatibility. For new Visual Basic code, you should use the Open, Close, Activate and Deactivate events instead of these macros."
In this case the second macro of this tip is a better choice:
Sub Workbook_Open()
Sheets("OpenToThisSheet").Activate
End Sub
"ActiveWorkbook." is supperflous because the macro resides in the ThisWorkbook code page and only runs when this workbook is active (loading).
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2021 Sharon Parq Associates, Inc.
Comments