Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Run Macro When Specific Sheet Selected

Can someone tell me the code to run a macro when a specific sheet is first
selected? I need it to have a text box appear momentarily when the user
selects the sheet. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Run Macro When Specific Sheet Selected

right click sheet tabview codeleft window select worksheetright window
select activate.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Carl" wrote in message
...
Can someone tell me the code to run a macro when a specific sheet is first
selected? I need it to have a text box appear momentarily when the user
selects the sheet. Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 185
Default Run Macro When Specific Sheet Selected

Carl

You can use a Worksheet_Activate() event like so

Private Sub Worksheet_Activate()
MsgBox "You activated sheet " & Me.Name
End Sub

To implement just right click on the sheet tab and select View Code. Paste
in the resulting window and save. Now when you activate that sheet the
msgbox will pop up

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk

UK Excel User Conference In Cambridge
November 28th - December 1st 2007
Register Now @ http://www.exceluserconference.com/UKEUC.html



"Carl" wrote in message
...
Can someone tell me the code to run a macro when a specific sheet is first
selected? I need it to have a text box appear momentarily when the user
selects the sheet. Thanks in advance.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Run Macro When Specific Sheet Selected

Thanks. Worked perfectly!

"Nick Hodge" wrote:

Carl

You can use a Worksheet_Activate() event like so

Private Sub Worksheet_Activate()
MsgBox "You activated sheet " & Me.Name
End Sub

To implement just right click on the sheet tab and select View Code. Paste
in the resulting window and save. Now when you activate that sheet the
msgbox will pop up

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk

UK Excel User Conference In Cambridge
November 28th - December 1st 2007
Register Now @ http://www.exceluserconference.com/UKEUC.html



"Carl" wrote in message
...
Can someone tell me the code to run a macro when a specific sheet is first
selected? I need it to have a text box appear momentarily when the user
selects the sheet. Thanks in advance.


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 to run specific macro on selected worksheet? Harshad[_2_] Excel Discussion (Misc queries) 2 October 31st 08 06:56 AM
Macro to delete specific rows above selected cell [email protected] Excel Programming 3 August 25th 06 04:14 PM
Specific cell selected when sheet opens...how??? Ron M. Excel Discussion (Misc queries) 3 February 17th 06 02:37 AM
Macro to move selected cell contents to a specific column on same row Ben Johnson[_3_] Excel Programming 1 February 10th 04 08:43 PM
Execute a Macro when specific value is selected in a Range Kevin Excel Programming 3 November 21st 03 03:54 AM


All times are GMT +1. The time now is 10:30 PM.

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"