Start with a specific worksheet when a Workbook is opened

J

Joe@excel

i have a work book Call *i*

and when open i want it to always start at *Data* sheet i found th
following code but i dont know what else i need to modify.


Private Sub Workbook_Open()
On Error Resume Next
Application.Goto Reference:=Worksheets("Data").Range("A1"), _
scroll:=True
If err = 9 Then 'actually is subscript out of range
MsgBox "Requested worksheet ""Data"" was not found " _
& "by Workbook_Open in ThisWorkbook."
End If
Worksheets("Menu Sheet").Activate
Sheets("Data").Move Before:=Sheets(1) 'insure is 1st sheet
On Error GoTo 0 'only needed if you have more code
End Sub

thank you in advanc
 
G

Gord Dibben

Joe

If you are sure you have a worksheet named "Data" in the workbook "i" place
this code in the ThisWorkbook module of "i".

Private Sub Workbook_Open()
Application.Goto Reference:=Worksheets("Data").Range("A1"), _
scroll:=True
End Sub


Gord Dibben Excel MVP
 

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

Top