AutoOpen in excel?

G

Guest

Hi,

I want my macro to start automatically when I create a new document based on
a template. In Word I normally use AutoOpen() and AutoNew(). Are there
similar functions in Excel that do the same thing?
 
W

William Benson

Store a subprocedure called Auto_Open in Personal.xls.

If you have not created any macros, you may not have a personal macro
workbook already created and residing in Excel's startup folder. If this is
the case, the best way I have found to get one generated is to turn on the
macro recorder, designate the Personal Macro Workbook as the place the macro
should be stored, click around a bit, turn off the recorder, and go to the
VB editor to look for the project in Personal.xls. There will be a "Module1"
module by this time and some code indicating your recent clicking/cell
selecting. You can get rid of the macro you created, and use this module
space to yupe a new macro. Such as ...

Sub Auto_Open
'put more VBA code here
End sub

good luck...

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top