John
Call your macro from Sub Workbook_Open (). Go to Tools > Macro > Visual Basic Editor and under "Microsoft Excel Objects" click on ThisWorkBook. Then use:
Sub WorkBook_Open ()
Call MyMacro
End Sub
How do I get a macro to run when a file is opened. I know there is a way but I can't remember where to put the macro to start up when the file is first openened.
Open the visual basic editor and place the macro in ThisWorkbook not in a module.
Place the macro within:
Private Sub Workbook_Open()
End Sub
Or within those lines put:
Application.Run.("Personal.XLS!My_Macro")
Regards,
Gary Hewitt-Long
In a normal module you can create a macro with the name " Auto_open() ". This macro will run when you open the file.
PS. The macro " Auto_close() " will do the same each time you close your file.
Good luck.
Lieuwer