Autorun macro on opening spreadsheet

  • Thread starter Thread starter simonjackson79
  • Start date Start date
S

simonjackson79

I just wanted to know how to setup a macro to run as soon as the
spreadsheet is open. Can anyone help me with this?

Many thanks.
 
go into the VBE (alt+F11) and in the project explorer on the left, select
ThisWorkbook entry under you workbook/project. Double click on it to get
the ThisWorkbook Module displayed. In this module at the top, in the left
dropdown, select Workbook and in the right dropdown, select Open. This will
put in the declaration for the workbook_Open event which fires when the
workbook is opened

Private Sub Workbook_Open()

End Sub

put your code or a call to your code in the above declaration.
 
Refer to the macro you want to run in the Workbook_Open section of
ThisWorkbook in Microsoft Excel Objects
 
Back
Top