File Start Up Macro

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.
 
J

JE McGimpsey

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.
 
B

Bigwheel

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)
 

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