View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Controlling Radio Button

I bet you've seen application.enableevents in event code.

That's the setting will allow the developer to tell excel to stop looking for
things that would cause an event to fire.

You can do the same kind of thing if you keep track yourself.

I used a commandbutton placed on a worksheet (Sheet1). This was the code in the
worksheet module:

Option Explicit
Private Sub CheckBox1_Change()
If BlkProc = True Then
Exit Sub
End If
MsgBox Me.CheckBox1.Value
End Sub


Then I added this to a General module (not behind a worksheet and not behind
ThisWorkbook):

Option Explicit
Public BlkProc As Boolean
Sub testme()
With Worksheets("sheet1").Range("a1")
BlkProc = True
.Value = Not .Value
BlkProc = False
End With
End Sub


The _Change event (or _Click if you use that) still fires, but the first thing
the code does is look to see if it should continue or just exit.



rk0909 wrote:

All,

Is it possible to NOT run a code associated with a radio button when the
linked cell is manually or programatically changed to TRUE.

In other words, I am trying to trigger a code when the user hits the radio
button, but in another scenario I want the to change the linked cell property
to TRUE while not running the associated code.

thanks much for your help.

R


--

Dave Peterson