Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Worksheet Activate

I have a sub that needs to fire any time a worksheet activates. I know how
to put the code below "behind" each worksheet, but was wondering if there a
way to place the code in a "Workbook" event so the code would achieve the
same results and execute any time a different sheet gets activated, but only
have to keep it in one place?

I have about 25 worksheets within my workbook and was trying to be more
efficient.

CODE:

Private Sub Worksheet_Activate()
Call mySub
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Worksheet Activate

Private Sub Workbook_SheetActivate(ByVal Sh As Object)

End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"scott" wrote in message
...
I have a sub that needs to fire any time a worksheet activates. I know how
to put the code below "behind" each worksheet, but was wondering if there a
way to place the code in a "Workbook" event so the code would achieve the
same results and execute any time a different sheet gets activated, but
only have to keep it in one place?

I have about 25 worksheets within my workbook and was trying to be more
efficient.

CODE:

Private Sub Worksheet_Activate()
Call mySub
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Worksheet Activate

i just found it, thanks.

"Bob Phillips" wrote in message
...
Private Sub Workbook_SheetActivate(ByVal Sh As Object)

End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"scott" wrote in message
...
I have a sub that needs to fire any time a worksheet activates. I know how
to put the code below "behind" each worksheet, but was wondering if there
a way to place the code in a "Workbook" event so the code would achieve
the same results and execute any time a different sheet gets activated,
but only have to keep it in one place?

I have about 25 worksheets within my workbook and was trying to be more
efficient.

CODE:

Private Sub Worksheet_Activate()
Call mySub
End Sub






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 activate the first worksheet? Meltad Excel Programming 3 July 23rd 07 05:14 PM
Add-ins and Worksheet activate HSalim[MVP] Excel Programming 3 June 6th 07 03:50 PM
Change Worksheet Button Caption on Worksheet.Activate MikeZz Excel Programming 1 December 7th 06 06:01 AM
Activate Previous worksheet after adding a new worksheet [email protected] Excel Programming 3 October 19th 05 01:01 AM
Worksheet activate Lee Hunter[_2_] Excel Programming 2 August 25th 04 05:55 PM


All times are GMT +1. The time now is 04:34 PM.

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

About Us

"It's about Microsoft Excel"