Auto Start a Macro in Excel 2007 VBA

C

christopher ward

Hi all experts -

I am using Excel 2007 VBA and have written a macro which i want to auto
start when Excel is started. I know this can be done but I cannot find the
option to do this. In good english could someone tell me where this is please
as I suspect it is just a setting in the properties panal or similar.

Thanks in advance if you help
 
B

Bob Phillips

Private Sub Workbook_Open()
'your code here
End Sub

This is workbook event code.
Go into the VBIDE - ALt-F11
Select the VBAProject for your workbook
Make sure that the Microsoft Excel Objects list is expanded
Select Thisworkbookf rom the list
Paste the code in the code window.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
D

Dylan

Creating a Worksheet OnOpen Event by double clicking the ThisWorkbook object
in Microsoft Excel Objects, then, selecting the =Open event from the right
hand dropdown, create a new Open event, then paste your macro code into it.

Regards
Dylan
 

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