Excel worksheet startup

  • Thread starter Thread starter Joseph
  • Start date Start date
J

Joseph

I would like to know how to have an Excel worksheet automatically execute a
macro on startup?
 
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
 
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.
 
Back
Top