Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Run a Macro on Startup for Specific Spreadsheet
Does any one know how I can setup a specific worksheet to run a macro only
when that specific worksheet is opened? Note: I do not want this macro to run for any other worksheet, just this specific one. Thanks |
#2
|
|||
|
|||
Rod
I think you are looking for: Private Sub Worksheet_Activate() in the specific worksheet class (code) module. For "open" read "activate". Regards Trevor "Rod" wrote in message ... Does any one know how I can setup a specific worksheet to run a macro only when that specific worksheet is opened? Note: I do not want this macro to run for any other worksheet, just this specific one. Thanks |
#3
|
|||
|
|||
Trevor, you Excel skills are greater than mine. Can you copy paste a
specific example assuming I had a macro named "autoexec"? Thanks, Rod "Trevor Shuttleworth" wrote: Rod I think you are looking for: Private Sub Worksheet_Activate() in the specific worksheet class (code) module. For "open" read "activate". Regards Trevor "Rod" wrote in message ... Does any one know how I can setup a specific worksheet to run a macro only when that specific worksheet is opened? Note: I do not want this macro to run for any other worksheet, just this specific one. Thanks |
#4
|
|||
|
|||
right click the sheet tabview codeleft window select worksheetright
window select activateinsert your macro to runSAVE -- Don Guillett SalesAid Software "Rod" wrote in message ... Trevor, you Excel skills are greater than mine. Can you copy paste a specific example assuming I had a macro named "autoexec"? Thanks, Rod "Trevor Shuttleworth" wrote: Rod I think you are looking for: Private Sub Worksheet_Activate() in the specific worksheet class (code) module. For "open" read "activate". Regards Trevor "Rod" wrote in message ... Does any one know how I can setup a specific worksheet to run a macro only when that specific worksheet is opened? Note: I do not want this macro to run for any other worksheet, just this specific one. Thanks |
#5
|
|||
|
|||
Rod
Private Sub Worksheet_Activate() autoexec End Sub Right-click on the sheet tab and "View Code". Copy/paste the above to that module. Note: autoexec must be available in the workbook, otherwise you have to point to it. Private Sub Worksheet_Activate() Application.Run ("mymacros.xla!autoexec") End Sub Gord Dibben Excel MVP On Wed, 16 Mar 2005 11:23:14 -0800, Rod wrote: Trevor, you Excel skills are greater than mine. Can you copy paste a specific example assuming I had a macro named "autoexec"? Thanks, Rod "Trevor Shuttleworth" wrote: Rod I think you are looking for: Private Sub Worksheet_Activate() in the specific worksheet class (code) module. For "open" read "activate". Regards Trevor "Rod" wrote in message ... Does any one know how I can setup a specific worksheet to run a macro only when that specific worksheet is opened? Note: I do not want this macro to run for any other worksheet, just this specific one. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I keep a macro with spreadsheet when moved | Excel Discussion (Misc queries) | |||
Macro not found when spreadsheet viewed in Internet Explorer? | Excel Discussion (Misc queries) | |||
Spreadsheet print including macro buttons? | Excel Discussion (Misc queries) | |||
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? | Excel Discussion (Misc queries) | |||
Run a macro when opening a spreadsheet | Excel Discussion (Misc queries) |