Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Need syntax for If statement to see if Worksheet_Activate code exists. For example If Sheet1.Worksheet_Activate = True Then Help please. Thank you. mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=490438 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Mike, Worksheet_Activate() is an event handler that exists for all Worksheets. To place code into this event, open the VBA editor by pressing ALT and F8. Activate the Project Explorer window by pressing ALT and R. Click on the sheet where you want to place your code. On your right is a the code window. At the top of the window you will see to drop down boxes. The left will say *(General)* and the other *(Declarations)*. Click on (General) and you will see *Worksheet* listed. Click on Worksheet. The other drop down will now show *Selection Change*. This is the default event. Click on the arrow of this drop down to see all the events for the worksheet. They are listed alphbetatically. At the top is *Activate*. Click on this and the following will appear in the code window... Private Sub Worksheet_Activate() End Sub In between Sub and End Sub you can add BEEP. This will generate an tone whenever the worksheet is activated. Each worksheet has it's own event handler. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=490438 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i'm not sure if this is what you are looking for, but how about this?
Sub findproctest() Dim oCodeM As Object Dim iStart As Long For Each oCodeM In ThisWorkbook.VBProject.VBComponents With oCodeM.codemodule On Error Resume Next iStart = 0 iStart = .ProcStartLine("worksheet_activate", vbext_pk_Proc) If iStart < 0 Then MsgBox "Worksheet_Activate() found in " & oCodeM.Name End If End With Next End Sub keizi "mikeburg" wrote in message ... Need syntax for If statement to see if Worksheet_Activate code exists. For example If Sheet1.Worksheet_Activate = True Then Help please. Thank you. mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=490438 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
if statement syntax help | Excel Worksheet Functions | |||
need help with syntax of if statement | Excel Worksheet Functions | |||
Code to see if Comment Exists | Excel Programming | |||
If syntax to test if command button exists | Excel Programming | |||
Worksheets Exists Code... | Excel Programming |