Start with a specific worksheet when a Workbook is opened

  • Thread starter Thread starter Joe@excel
  • Start date Start date
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
 
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
 
Back
Top