Hi,
I'm trying to disable a Form Control button if a certain Form Control Option Button is checked. The only problem is that the button won't disable, hence, allowing me to continue running the macro.
My code is as follows:
Dim optBtn66 As Excel.OptionButton
Set optBtn66 = Worksheets("Question 1").Shapes.Item("Option Button 66").OLEFormat.Object
If optBtn66.Value = 1 Then
MsgBox ("Correct! Move to the next question.")
Worksheets("Question 1").Range("I97") = "Correct!"
Worksheets("Question 1").Shapes.Item("Button 70").ControlFormat.Enabled = False
Else:
Worksheets("Question 1").Range("I97") = "Incorrect!"
Worksheets("Question 1").Shapes("Button 70").ControlFormat.Enabled = False
Worksheets("Q1ANS").Range("E43").Value = 2
MsgBox ("Incorrect. Move to the next question.")
End If
Thanks in advance!!
I'm trying to disable a Form Control button if a certain Form Control Option Button is checked. The only problem is that the button won't disable, hence, allowing me to continue running the macro.
My code is as follows:
Dim optBtn66 As Excel.OptionButton
Set optBtn66 = Worksheets("Question 1").Shapes.Item("Option Button 66").OLEFormat.Object
If optBtn66.Value = 1 Then
MsgBox ("Correct! Move to the next question.")
Worksheets("Question 1").Range("I97") = "Correct!"
Worksheets("Question 1").Shapes.Item("Button 70").ControlFormat.Enabled = False
Else:
Worksheets("Question 1").Range("I97") = "Incorrect!"
Worksheets("Question 1").Shapes("Button 70").ControlFormat.Enabled = False
Worksheets("Q1ANS").Range("E43").Value = 2
MsgBox ("Incorrect. Move to the next question.")
End If
Thanks in advance!!