makeitwork09
Technical User
I am using Excel 2007
In a workbook, on the first sheet, I have two option buttons and a checkbox
called OptionButton1, OptionButton2, and CheckBox1, respectively.
In the properties, OptionButton1 and OptionButton2 have a GroupName of
RecType.
The value of OptionButton1 is No
The value of OptionButton2 is Yes
If OptionButton1 is selected I want Checkbox1 to be disabled.
I did the following code, but it is not disabling Checkbox1 when
OptionButton1 is selected.
In a workbook, on the first sheet, I have two option buttons and a checkbox
called OptionButton1, OptionButton2, and CheckBox1, respectively.
In the properties, OptionButton1 and OptionButton2 have a GroupName of
RecType.
The value of OptionButton1 is No
The value of OptionButton2 is Yes
If OptionButton1 is selected I want Checkbox1 to be disabled.
I did the following code, but it is not disabling Checkbox1 when
OptionButton1 is selected.
Code:
Private Sub OptionButton1_Click()
If OptionButton1 Then
CheckBox1.Value = False
CheckBox1.Enabled = False
End If
End Sub
Private Sub OptionButton2_Click()
If OptionButton2 Then
CheckBox1.Value = False
CheckBox1.Enabled = True
End If
End Sub