View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Kit[_2_] Kit[_2_] is offline
external usenet poster
 
Posts: 1
Default Automatically run macro when opening file

Add a SUB procedure titled Auto_Open to your module.
execute your code in that SUB or call your routine as
needed. The next time you open the spreadsheet your code
will automatically run.

Holding down the SHIFT key when opening the spreadsheet
will suppress running the Auto_Open routine for testing.

Sub Auto_Open()

myRoutine

End Sub

Sub myRoutine()

'Do your code here

End Sub

-----Original Message-----
Hello,
I would like to run a macro automatically when the Excel

file opens.
The macro is written, but what do I do from here?

Thank you,
Chris
.