ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Start a Macro in Excel 2007 VBA (https://www.excelbanter.com/excel-programming/414114-auto-start-macro-excel-2007-vba.html)

christopher ward

Auto Start a Macro in Excel 2007 VBA
 
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
--
C Ward

Bob Phillips

Auto Start a Macro in Excel 2007 VBA
 

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)

"christopher ward" wrote in
message ...
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
--
C Ward




dylan

Auto Start a Macro in Excel 2007 VBA
 
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

"christopher ward" wrote:

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
--
C Ward



All times are GMT +1. The time now is 07:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com