Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to run VBA macro when the workbook is open?
Hi
I write a Macro in VBA IDE module 1 as: sub Selection() xxxxxxx end sub If I want EXCEL to run it when this workbook is open,how can I do that by VBA for that ?(Any sample code available?) Thanks! BRs Ji |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to run VBA macro when the workbook is open?
Hi:
Put the following macro in the ThisWorkbook code module: Private Sub Workbook_Open() Call Selection End Sub I would suggest calling the macro something other than "Selection", though. Never use reserved words as names! Regards, Vasant. "Ji Wenke" wrote in message ... Hi I write a Macro in VBA IDE module 1 as: sub Selection() xxxxxxx end sub If I want EXCEL to run it when this workbook is open,how can I do that by VBA for that ?(Any sample code available?) Thanks! BRs Ji |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro in 2nd Open workbook | Excel Discussion (Misc queries) | |||
Open Workbook Macro??? | Excel Discussion (Misc queries) | |||
Run a macro when I open a workbook | Excel Discussion (Misc queries) | |||
How to Run Macro in open workbook/s | Excel Discussion (Misc queries) | |||
run macro on workbook open | Excel Discussion (Misc queries) |