View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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.