I'm using a lot of checkbox's on a sheet and I would like to 'Select All' for only some of them. Currently I have a code that uses a checkbox to select all and deselect all.
Here is the code I'm using:
What I need is for Checkbox's 18 to 48 to have a 'Select All' Button without effecting the earlier Checkbox's.
If anyone could help me with this I would greatly appreciate it.
Thanks in advance
Here is the code I'm using:
Code:
Private Sub CheckBox17_Click()
Dim ws As Worksheet
Dim oj As OLEObject
Set ws = ActiveSheet
'Cycle through all of the check boxes in the ActiveSheet
If CheckBox17.Value = True Then
For Each oj In ws.OLEObjects
If TypeName(oj.Object) = "CheckBox" Then
oj.Object.Value = True
End If
Next oj
Else:
Set ws = ActiveSheet
'Cycle through all of the check boxes in the ActiveSheet
For Each oj In ws.OLEObjects
If TypeName(oj.Object) = "CheckBox" Then
oj.Object.Value = False
End If
Next oj
End If
End Sub
If anyone could help me with this I would greatly appreciate it.
Thanks in advance