ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatic Macros (https://www.excelbanter.com/excel-programming/281816-automatic-macros.html)

Diego[_2_]

Automatic Macros
 
Hey! I need some help form the pros, I need to create a
macro that runs automatically when the workbook in excel
opens, How do I do that? Thanks

Stef C

Automatic Macros
 
Use the Workbook_Open event of your workbook.

ex:
In your workbook VBA module

Private Sub Workbook_Open()

msgbox "Workbook Open!!!!!"

end sub



-----Original Message-----
Hey! I need some help form the pros, I need to create a
macro that runs automatically when the workbook in excel
opens, How do I do that? Thanks
.


Chip Pearson

Automatic Macros
 
Diego,

You can name the macro Auto_Open. Alternatively, you can use the Open event
of the workbook. In the ThisWorkbook code module, use

Private Sub Workbook_Open()
' your code here
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Diego" wrote in message
...
Hey! I need some help form the pros, I need to create a
macro that runs automatically when the workbook in excel
opens, How do I do that? Thanks




Diego[_2_]

Automatic Macros
 
Thanks!!!! I tried naming it auto_open it worked. By the
way...How do I get to the this workbook code module? I
couldn't do it. Regards.

-----Original Message-----
Diego,

You can name the macro Auto_Open. Alternatively, you can

use the Open event
of the workbook. In the ThisWorkbook code module, use

Private Sub Workbook_Open()
' your code here
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Diego" wrote in

message
...
Hey! I need some help form the pros, I need to create a
macro that runs automatically when the workbook in excel
opens, How do I do that? Thanks



.


Chip Pearson

Automatic Macros
 
Diego,

You get to the ThisWorkbook module by first displaying the Project Explorer
window (View menu, Project Explorer, or just CTRL+R). Find your project in
the TreeView on the left side of the screen, and expand the folder. You'll
see a folder called "Microsoft Excel Objects". Expand that, and double click
the ThisWorkbook icon.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Diego" wrote in message
...
Thanks!!!! I tried naming it auto_open it worked. By the
way...How do I get to the this workbook code module? I
couldn't do it. Regards.

-----Original Message-----
Diego,

You can name the macro Auto_Open. Alternatively, you can

use the Open event
of the workbook. In the ThisWorkbook code module, use

Private Sub Workbook_Open()
' your code here
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Diego" wrote in

message
...
Hey! I need some help form the pros, I need to create a
macro that runs automatically when the workbook in excel
opens, How do I do that? Thanks



.





All times are GMT +1. The time now is 04:34 PM.

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