Hello,
I am creating a online multiple choice quiz in excel.
I only want the user to select 1 answer. So if they selected another answer the all the others are unchecked.
I just can't figure it out.
So there is the setup of the test....
I want only one answered to be selected. So if the user clicks on answer any other checkbox becomes unchecked.
(Hope this makes sense)
Thanks!
I am creating a online multiple choice quiz in excel.
I only want the user to select 1 answer. So if they selected another answer the all the others are unchecked.
I just can't figure it out.
So there is the setup of the test....
VBA Code:
Private Sub UserForm_Initialize()
'multiple choice
Dim res As Worksheet
Set res = Worksheets("RESULT")
Dim su As Worksheet
Set su = Worksheets("setup")
Me.Label3 = res.Cells(Gline, 7)
'determin # of answers
ans = 4
If su.Cells(Gline, 7) = "" Then ans = 3
If su.Cells(Gline, 6) = "" Then ans = 2
Me.CheckBox1.Caption = res.Cells(Gline, 9)
Me.CheckBox2.Caption = res.Cells(Gline, 10)
If res.Cells(Gline, 11) <> "" Then
Me.CheckBox3.Caption = res.Cells(Gline, 11)
Else
Me.CheckBox3.Visible = False
End If
If res.Cells(Gline, 12) <> "" Then
Me.CheckBox4.Caption = res.Cells(Gline, 12)
Else
Me.CheckBox4.Visible = False
End If
End Sub
I want only one answered to be selected. So if the user clicks on answer any other checkbox becomes unchecked.
(Hope this makes sense)
Thanks!