Control what Tab opens first when opening a workbook

  • Thread starter Thread starter MikeM
  • Start date Start date
M

MikeM

I have a Workbook file with many worktabs in it. Such as : Main Page, Cover,
Scorecard.... Whenever I open the file, it always opens to the "Cover"
page. I want it to open to the "Main Page" . How can I contro; this?
 
Before saving goto that sheet>save>close. Put a before_close event macro in
the ThisWorkbook module
 
Excel opens the file to the location that was active when the file was
closed (assuming you save changes). You can set the startup range in
the Workbook_Open procedure. In VBA, open up the ThisWorkbook module
and enter the following code:

Private Sub Workbook_Open()
ThisWorkbook.Worksheets("Main Page").Select
End Sub

OR you can use

Private Sub Workbook_Open()
Application.Goto _
ThisWorkbook.Worksheets("Main Page").Range("A1"), True
End Sub

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top