Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rod
 
Posts: n/a
Default 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   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

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   Report Post  
Rod
 
Posts: n/a
Default

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   Report Post  
Gord Dibben
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I keep a macro with spreadsheet when moved SpeclAngel Excel Discussion (Misc queries) 1 March 8th 05 02:08 PM
Macro not found when spreadsheet viewed in Internet Explorer? Ben Excel Discussion (Misc queries) 1 February 10th 05 07:31 PM
Spreadsheet print including macro buttons? gunga Excel Discussion (Misc queries) 4 February 10th 05 06:30 PM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller Excel Discussion (Misc queries) 1 February 8th 05 09:34 AM
Run a macro when opening a spreadsheet Duncan Help Excel Discussion (Misc queries) 5 January 10th 05 05:33 PM


All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"