View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Soo Cheon Jheong[_2_] Soo Cheon Jheong[_2_] is offline
external usenet poster
 
Posts: 46
Default option buttons run Click code when value is changed via VBA code

Hi,

1) Put this in your Standard Code Module:

Public X As Boolean
Sub TEST()
X = True
ActiveSheet.OLEObjects("OptionButton1").Object.Val ue = True
X = False
End Sub


2) Put this in your Worksheet Code Module:

Private Sub OptionButton1_Click()
If X = True Then Exit Sub

MsgBox "Actually selected"
........
........
End Sub



--
Regards,
Soo Cheon Jheong
_ _
^вп^
--