I am trying to enable/disable a option buttons dependent on the selection of another option button. So if I select OptionButton210, OptionButton 222 and 223 should be disabled. When OptionButton210 is deselected again by a different selection the OptionButtons 222 and 223 should be enabled again.
The code I have tried so far does not work:
Private Sub OptionButton210_Change()
If ActiveSheet.OLEObjects("OptionButton210").Value = True Then
ActiveSheet.OLEObjects("OptionButton222").Visible = False
ActiveSheet.OLEObjects("OptionButton223").Visible = False
Else
ActiveSheet.OLEObjects("OptionButton222").Visible = True
ActiveSheet.OLEObjects("OptionButton223").Visible = True
End If
End Sub
What is the correct code to do this? I get an error on the first line.
The code I have tried so far does not work:
Private Sub OptionButton210_Change()
If ActiveSheet.OLEObjects("OptionButton210").Value = True Then
ActiveSheet.OLEObjects("OptionButton222").Visible = False
ActiveSheet.OLEObjects("OptionButton223").Visible = False
Else
ActiveSheet.OLEObjects("OptionButton222").Visible = True
ActiveSheet.OLEObjects("OptionButton223").Visible = True
End If
End Sub
What is the correct code to do this? I get an error on the first line.