File Start Up Macro

  • Thread starter Thread starter Dave B
  • Start date Start date
D

Dave B

How do I get a macro to run when I start a file? I want the
file to start on a specific sheet each time I open the file.
 
Put this in the workbook's ThisWorkbook code module (right-click the
workbook title bar and choose View Code):

Private Sub Workbook_Open()
Sheets("Sheet1").Select
End Sub

or

Private Sub Workbook_Open()
Application.GoTo Sheets("Sheet1").Range("A1")
End Sub

The latter selects a particular cell, naturally.
 
Create an auto opening macro ...

Sub auto_open()
your code here
end sub

P.S. there's also a complemenary auto_close macro to reset things
afterwards (if needed)
 
Back
Top