How to execute a macro automatically on startup

J

John Gilchrist

Currently I execute a macro either with a short-cut key (^w) or a custom
menu entryon the TOOLS menu.

Is there any way to automatically execute the macro when excel starts up
(i.e. open excel to the desired workbook, and automatically run one of that
workbook's macros on startup. )

Thanks,
John G.
 
P

Peo Sjoblom

Open the workbook, do Alt + F11, double click ThisWorkbook in the left
project pane

Private Sub Workbook_Open()

End Sub


put either a reference to your macro like

Private Sub Workbook_Open()
Macro1
End Sub

or put the whole code in there
 

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