I like counting the amount of red cell trigger by conditional formatting. I found a nice script on the internet. It works wel when i color a cal myself. But the cells that are colored with conditional formatting don't get count. Is there a fix or a better script for this problem.
A second software is a no go because of company policy.
Function CountCellsByColor(rData As Range, cellRefColor As Range) As Long
Dim indRefColor As Long
Dim cellCurrent As Range
Dim cntRes As Long
Application.Volatile
cntRes = 0
indRefColor = cellRefColor.Cells(1, 1).Interior.Color
For Each cellCurrent In rData
If indRefColor = cellCurrent.Interior.Color Then
cntRes = cntRes + 1
End If
Next cellCurrent
CountCellsByColor = cntRes
End Function
Bookmarks