View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Worksheet_Change event not running from Form control.

If you are trying to change the value in the linked cell with the option
button, you could be cancelling you own value. The linked cell for an option
button only returns True or False, boolean results. You would need to use a
Target cell to activate the change event. I cannot determine much more
without seeing the relevant code.

"JLGWhiz" wrote:

No, my setup is for the manual click of the radio button to change the value
in cell b3, which then triggers the message box. If you would post your
code, maybe we could help debug the problem.

"Brad E." wrote:

JLG - If I understand correctly, you are running a macro when you select the
radio button - which in turn changes B3 - which in turn triggers the
Worksheet_Change event. Mine is set up a little differently in that I have
linked my 3 radio buttons (grouped) to cell C7. So when I push the first
radio button, C7 changes to 1, second and C7 = 2, third and C7 = 3. These
changes are not triggering the Worksheet_Change event though.
--
Brad E.

"JLGWhiz" wrote:

I put a radio button from the Control Tool Box on a sheet and put the code
below behind the sheet. I could not duplicate the problem. The option
button code triggered the change event each time.

Private Sub OptionButton1_Click()
If Range("B3") < 5 Then
Range("B3") = Range("B3").Value + 1
Else
Range("B3") = Range("B3").Value - 1
End If
Sheets(1).OptionButton1 = False
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B3") Then
MsgBox "Bingo"
End If
End Sub





"Brad E." wrote:

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.