Run a macro at startup

  • Thread starter Thread starter Robyn Thomas
  • Start date Start date
R

Robyn Thomas

I have a macro that I need to run in an Excel file when
the worksheet opens.

Any ideas?

Robyn
 
Robyn,

You can use the Workbook_Open event under ThisWorkbook

eg.
Private Sub Workbook_Open()
MsgBox "Hello!"
End Sub

Or you can include a Sub in one of the modules called: Auto_Open
(I think this is an older way of doing it - you should use Workbook_Open)

eg.
Sub Auto_Open()
MsgBox "Hello!"
End Sub

Rob
 
Back
Top