How to auto activate macro when file open ?

B

bonzio

I have created a macro (in the visual basic editor as sub function/procedure)
in my file, and I want to activate it as soon as the file open or when the
":" button is pressed. Anybody that can help me with this problem ?
Thank's.
 
K

Ken Johnson

Hi Bonzio,

Double click the ThisWorkbook icon in the Project Explorer to Expose
the ThisWorkbook Code Module. At the top of the blank module you should
see (General) on the left and (Declarations) on the right. Change
(General) to (Workbook) by clicking the down arrow and selecting
(Workbook). When you do that an empty Workbook_Open Sub will appear.
Type the name of the Sub you want to run here and it will run when the
workbook is open.

Ken Johnson
 
Top