Mike
This is an example of a solution to use the same code for a group of CheckBoxes.
Please do the test as is, before adapting to your case.
1 - In a new workbook, in Sheet1 insert some checkboxes from the control toolbar.
In some of the checkboxes set the property GroupName to "CBoxGrp1". These are the checkboxes that will run the common code. You can set this property with vba but for this test it's maybe easier if you change it directly in the property sheet of the control.
2 - Define a class with the behaviour of that group of checkboxes.
Insert a class module. Change its name to "clsCBoxGrp1"
Paste the code:
Code:
Option Explicit
Private WithEvents CBoxP As MSForms.CheckBox
Property Set CBoxObj(ctrlCBox As MSForms.CheckBox)
Set CBoxP = ctrlCBox
End Property
Private Sub CBoxP_Change()
MsgBox "Hi, I'm " & CBoxP.Name
End Sub
As you can see, in this exampe a checkbox when ticked will simply identify itself.
3 - In a general module paste:
Code:
Option Explicit
Public CollCBoxGrp1 As Collection
Private Sub CBoxGrp1Init()
Dim clsCBox As clsCBoxGrp1
Dim OLEObj As OLEObject
Set CollCBoxGrp1 = New Collection
For Each OLEObj In Worksheets("Sheet1").OLEObjects
If OLEObj.progID = "Forms.CheckBox.1" Then
If OLEObj.Object.GroupName = "CBoxGrp1" Then
Set clsCBox = New clsCBoxGrp1
CollCBoxGrp1.Add clsCBox
Set clsCBox.CBoxObj = OLEObj.Object
End If
End If
Next OLEObj
End Sub
This code will associate all the checkboxes in the group to the class we created.
4 - Test the solution
Run CBoxGrp1Init().
In the worksheet tick some of the checkboxes and see if the ones that you identified as belonging to the group "CBoxGrp1" behave as expected.