Auto execute macro setup

glensnow

New Member
Joined
Oct 29, 2005
Messages
16
I am new to VB and an looking to have a macro automatically execute when the file is opened. Can someone help??

Thanks
Glen
 

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

anthonya2369

Active Member
Joined
Mar 10, 2005
Messages
321
Under the ThisWorkbook item, you can.

Code:
Private Sub Workbook_Open()
    MsgBox "test"
End Sub

This would pop up Test message box everytime the workbook was open.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,798
Messages
5,574,372
Members
412,589
Latest member
ArtBOM
Top