Hi,
I have checkboxes in cells (one per cell) that are related to those cell. They allow a user to select criteria but I wish he could select 6 maximum, so anytime one is used, I would like to count how many "True" I already have in that range (called 'TrueCriteria'). If I use the below macro, the event happens if I change the value manually from true to false but not if I do so using the checkbox
I have checkboxes in cells (one per cell) that are related to those cell. They allow a user to select criteria but I wish he could select 6 maximum, so anytime one is used, I would like to count how many "True" I already have in that range (called 'TrueCriteria'). If I use the below macro, the event happens if I change the value manually from true to false but not if I do so using the checkbox
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 8 Then
Dim i As Long: i = Application.WorksheetFunction.CountIf([TrueCriteria], True)
MsgBox i
End If
End Sub