Excel worksheet startup

J

Joseph

I would like to know how to have an Excel worksheet automatically execute a
macro on startup?
 
J

John Wilson

Joseph,

The easy way is to use the Auto_Open macro.

Sub Auto_Open()
' your macro here
End Sub

Another way would be to use the Workbook_Open Event handler.

John
 
D

Dave Peterson

You can put your code in a general module and name that macro auto_open. (You
could also put the code in the workbook_open event under the ThisWorkbook
module.)

Then when you open your workbook (with macros enabled), your code will run.
 

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