Private Sub Workbook_Open()

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?
 
J

Jacob Skaria

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.
 

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