jamescooper
Well-known Member
- Joined
- Sep 8, 2014
- Messages
- 834
So my following code successfully only allows either checkbox 1 or checkbox 2 to be ticked at one time.
I want to now expand this with Checkbox 8 OR checkbox 9.
I need to know how to adapt the code below to achieve this please?
Thanks.
I want to now expand this with Checkbox 8 OR checkbox 9.
I need to know how to adapt the code below to achieve this please?
Thanks.
VBA Code:
Private Sub CheckBox1_Change()
Dim ctl As MSForms.Control
If Me.CheckBox1.Value = True Then
For Each ctl In Me.Controls
If TypeName(ctl) = "CheckBox" And ctl.Name <> "CheckBox1" Then
ctl.Value = False
End If
Next ctl
End If
End Sub
Private Sub CheckBox2_Change()
Dim ctl As MSForms.Control
If Me.CheckBox2.Value = True Then
For Each ctl In Me.Controls
If TypeName(ctl) = "CheckBox" And ctl.Name <> "CheckBox2" Then
ctl.Value = False
End If
Next ctl
End If
End Sub