Excel 2003 - VBA - AutoExecute

C

C Brandt

Apologies. I seem to have lost track of a solution already in hand, so I
have to ask again.

Upon loading a prepared workbook, I would like a macro to auto execute
setting up some of the preliminaries in preperation for a session.

How do I do that?

Thanks,
Craig
 
M

Mike H

You can do it in a couple of ways if you mean auto run a macro when opening a
workbook you could use the workbook_open event:-

Private Sub Workbook_Open()
MsgBox "another message"
End Sub

or create you own in a general module

Sub auto_open()
MsgBox "msg"
End Sub

Mike
 
G

Gord Dibben

Private Sub Workbook_Open()
your code or macroname goes here
End Sub

Entered in Thisworkbook module.


Gord Dibben MS Excel MVP
 
Top