I ran this macro to assign a linked cell to each checkbox, uses the cell the checkbox is on, you can set the text color to match the cell colors so the true and false are not visible.
Sub LoopThroughFormCheckboxes()
Dim chkbox As CheckBox
For Each chkbox In ActiveSheet.CheckBoxes
With chkbox
.LinkedCell = .TopLeftCell.Address
End With
Next chkbox
End Sub
Altered your sub to this.
Hopefully you can follow the comments
Sub AddMembers()
Dim rng As Range, cel As Range, sStr As String
Dim Ws As Worksheet, wksheets As Variant
Dim i As Long, c As Range
'Loop through each check box linked cell
Set rng = Sheets("dates").Range("J2:J13")
' build a string of month names
For Each cel In rng
If cel.Value = True Then
sStr = sStr & "," & MonthName(cel.Row - 1, True)
End If
Next cel
' split the string to get array of month names
wksheets = Split(Mid(sStr, 2), ",")
' loop through the array of month names
For i = LBound(wksheets) To UBound(wksheets)
On Error Resume Next 'in case sheet doesn't exist for that month
Set Ws = Sheets(wksheets(i))
On Error GoTo 0 're-instate error notifications
If Not Ws Is Nothing Then 'if that worksheet does exist
'test members
Sheets("dates").Range("f2:g11").Copy Ws.Range("a4") ':a10") '<~~~ mismatched range sizes
For Each c In Ws.Range("a4:a10")
If c.Value = Sheets("dates").Range("I2") Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next
End If
Next i
End Sub
Hope that helps
Bookmarks