ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel worksheet startup (https://www.excelbanter.com/excel-programming/279968-excel-worksheet-startup.html)

Joseph[_7_]

Excel worksheet startup
 
I would like to know how to have an Excel worksheet automatically execute a
macro on startup?



John Wilson

Excel worksheet startup
 
Joseph,

The easy way is to use the Auto_Open macro.

Sub Auto_Open()
' your macro here
End Sub

Another way would be to use the Workbook_Open Event handler.

John


"Joseph" wrote in message
...
I would like to know how to have an Excel worksheet automatically execute

a
macro on startup?





Dave Peterson[_3_]

Excel worksheet startup
 
You can put your code in a general module and name that macro auto_open. (You
could also put the code in the workbook_open event under the ThisWorkbook
module.)

Then when you open your workbook (with macros enabled), your code will run.


Joseph wrote:

I would like to know how to have an Excel worksheet automatically execute a
macro on startup?


--

Dave Peterson


Joseph[_8_]

Excel worksheet startup
 
Thanks guys!




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

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