Private Sub Workbook_Open()

  • Thread starter Thread starter Helmut
  • Start date Start date
H

Helmut

Hi I want this Macro to run when the Workbook is opened:

Private Sub Workbook_Open()
MsgBox "Hi I am here"
End Sub

The workbook opens asks me if I want to run macros - I enable
but nothing else happens.
what must I do to make the macro run?
 
You should paste the code to the Workbook module..In Visual Basic Editor from
the left treeview search for the workbook name and click on + to expand it.
Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the same code to the right code pane.
 
Back
Top