Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you get a macro to run upon opening a SpSheet
Hi,
I have a macro already built into the spreadsheet, but I need to add a code that would make the macro run when the spreadsheet is initially opened by the user. Any ideas??? Thanks. Kate |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you get a macro to run upon opening a SpSheet
When the Spreadsheet is Activated
Or when the Workbook is Opened? You probably mean the latter, but it matters. In the Visual Basic Editor, Project Window, Right click on the ThisWorkbook item. (it is just above the Modules folder). Choose View Code It will be blank. In the left drop down box in the Edit window (it will say "(General)"), choose Workbook. In the right Drop Down, Choose Open (by default. Private Sub Workbook_Open() MyMacro End Sub A word of advice. Almost all you VBA in the Modules. Only put calls to modules in the this "code behind". Stephen Rasey Houston http://wiserways.com http://excelsig.org "Kate" wrote in message ... Hi, I have a macro already built into the spreadsheet, but I need to add a code that would make the macro run when the spreadsheet is initially opened by the user. Any ideas??? Thanks. Kate |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you get a macro to run upon opening a SpSheet
Hello Kate,
Name your macro Auto_Open i.e. Sub Auto_Open() 'your code End Sub Hope this helps, Kris -----Original Message----- Hi, I have a macro already built into the spreadsheet, but I need to add a code that would make the macro run when the spreadsheet is initially opened by the user. Any ideas??? Thanks. Kate . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you get a macro to run upon opening a SpSheet
Hi Kate
Sub Auto_open() MsgBox "Hi" End Sub Must be in a normal module If you use a Auto_open macro then this wil not run if you open the file with a macro Private Sub Workbook_Open() Msgbox "Workbook Opened" End Sub Must be in the Thisworkbook module -- Regards Ron de Bruin http://www.rondebruin.nl "Kate" wrote in message ... Hi, I have a macro already built into the spreadsheet, but I need to add a code that would make the macro run when the spreadsheet is initially opened by the user. Any ideas??? Thanks. Kate |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you get a macro to run upon opening a SpSheet
I'll be... It is not in the help, but Auto_Open works.
Stephen Rasey "Kris" wrote in message ... Hello Kate, Name your macro Auto_Open i.e. Sub Auto_Open() 'your code End Sub Hope this helps, Kris -----Original Message----- Hi, I have a macro already built into the spreadsheet, but I need to add a code that would make the macro run when the spreadsheet is initially opened by the user. Any ideas??? Thanks. Kate . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you get a macro to run upon opening a SpSheet
hi,
yes. move the code to the workbooks Open event. open the workbook. then open VB editor. open the module your code is in. copy it. in the project pane, douple click this workbook. above the code window, click the righ box,select workbook. on the left side box , click open. Paste your code in the code window. the macro should fire when the work book is opne. -----Original Message----- Hi, I have a macro already built into the spreadsheet, but I need to add a code that would make the macro run when the spreadsheet is initially opened by the user. Any ideas??? Thanks. Kate . |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you get a macro to run upon opening a SpSheet
http://www.cpearson.com/excel/events.htm
Chip Pearson's page on events -- Regards, Tom Ogilvy "Kate" wrote in message ... Hi, I have a macro already built into the spreadsheet, but I need to add a code that would make the macro run when the spreadsheet is initially opened by the user. Any ideas??? Thanks. Kate |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you get a macro to run upon opening a SpSheet
Workbook_open wasn't introduced until xl97. xl5 and xl95 used Auto_open and
Auto_close. Before that, the xl4 macro language used Auto_open xl4 macros. -- Regards, Tom Ogilvy "Stephen Rasey" wrote in message ... I'll be... It is not in the help, but Auto_Open works. Stephen Rasey "Kris" wrote in message ... Hello Kate, Name your macro Auto_Open i.e. Sub Auto_Open() 'your code End Sub Hope this helps, Kris -----Original Message----- Hi, I have a macro already built into the spreadsheet, but I need to add a code that would make the macro run when the spreadsheet is initially opened by the user. Any ideas??? Thanks. Kate . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro buttons opening saved macro | Excel Discussion (Misc queries) | |||
run macro on opening | Excel Discussion (Misc queries) | |||
Macro upon opening | Excel Worksheet Functions | |||
Run Macro Upon Opening | Excel Programming | |||
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet | Excel Programming |