JimS
11-16-2012, 12:29 PM
I have 6 Toolbar Form Controls Checkboxes (not Active-X style) and want to limit the maximum selected to 3.
I found some code online but cannot convert it to work with a Form Control Type Checkbox.
Any ideas?
Thanks...
JimS
Sub ckb_1_Change()
Dim Count As Integer
Count = 0
If ckb_1.Value = True Then Count = Count + 1
If ckb_2.Value = True Then Count = Count + 1
If ckb_3.Value = True Then Count = Count + 1
If ckb_4.Value = True Then Count = Count + 1
If ckb_5.Value = True Then Count = Count + 1
If ckb_6.Value = True Then Count = Count + 1
If Count > 3 Then ckb_1.Value = False
End Sub
I found some code online but cannot convert it to work with a Form Control Type Checkbox.
Any ideas?
Thanks...
JimS
Sub ckb_1_Change()
Dim Count As Integer
Count = 0
If ckb_1.Value = True Then Count = Count + 1
If ckb_2.Value = True Then Count = Count + 1
If ckb_3.Value = True Then Count = Count + 1
If ckb_4.Value = True Then Count = Count + 1
If ckb_5.Value = True Then Count = Count + 1
If ckb_6.Value = True Then Count = Count + 1
If Count > 3 Then ckb_1.Value = False
End Sub