ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Private Sub Workbook_Open() (https://www.excelbanter.com/excel-programming/440167-private-sub-workbook_open.html)

Helmut

Private Sub Workbook_Open()
 
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?

Jacob Skaria

Private Sub Workbook_Open()
 
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.

--
Jacob


"Helmut" wrote:

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?



All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com