ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Load Macro at start up? (https://www.excelbanter.com/excel-programming/280145-re-load-macro-start-up.html)

Tom Ogilvy

Load Macro at start up?
 
open the workbook. Go to the VBE (alt+F11), look in the project explorer for
your workbook, select the ThisWorkbook entry for your workbook. Double
click on it and it should open the ThisWorkbook Module. In the left
dropdown at the top of the module, select Workbook and from the right
dropdown select Open. At any point in this process you may see the
procedure declaration for the Workbook_Open event appear in the module.
(All steps will guarantee it).

Private Sub Workbook_Open()

End Sub

put your code in that Event or call you existing sub from that event.

If you want to learn what events are available, see Chip Pearson's site:

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"MJ Antoszkiw" wrote in message
...
How could I load a macro as soon as the workbook is opened?
Thanks.
MJ Antoszkiw.





All times are GMT +1. The time now is 06:18 AM.

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