Tom’s Tutorials For Excel: Open a Workbook To a Specific Sheet and Cell
How can you open a workbook to a specific worksheet and cell? For example, regardless of where you were in the workbook when it was last closed, if you always want the workbook to open by taking you to cell A1 of Sheet3, here’s how.
In VBA terms, the code to accomplish this is a workbook-level event, meaning the code will be placed into the “ThisWorkbook” module of your workbook.
To find your workbook module for Excel versions 2003 or before:
Find the small Excel workbook icon near the upper left corner of your workbook window, usually just to the immediate left of the File menu option. Right-click on that icon, and left-click to select the View Code menu item.
If you are using Excel version 2007 or 2010:
From your worksheet press
Alt+F11, then press
Find your workbook name in the “Project – VBAProject” left vertical pane (it will be in bold font, looking like
VBAProject (YourWorkbookName.xlsx). Expand the Microsoft Excel Object folder for your workbook, right-click on ThisWorkbook and left-click to select View Code.
For any version of Excel, paste this code into the large white area that is your workbook module.
After that, return to your worksheet by pressing
Alt+Q and save your workbook.
Private Sub Workbook_Open() Application.Goto Worksheets("Sheet3").Range("A1") End Sub
If you want to go to, say, cell CD1025 on Sheet3, and ensure that cell CD1025 is always in the top left corner of your worksheet when you open the workbook, set the GoTo argument for Scroll to True, as in this example:
Private Sub Workbook_Open() Application.Goto Worksheets("Sheet3").Range("CD1025"), True End Sub