I have created conditional fomatting with the condition =AND(I2-TODAY()<=90,I2-TODAY()>$P$990). This works well and formats the cells correctly with expiry dates of between today and 90 days time. I now need to count the umber of cells of that colour in each column & have created a function:
Function GetColorCount(CountRange As Range, CountColor As Range)
Dim CountColorValue As Integer
Dim TotalCount As Integer
CountColorValue = CountColor.Interior.ColorIndex
Set rCell = CountRange
For Each rCell In CountRange
If rCell.Interior.ColorIndex = CountColorValue Then
TotalCount = TotalCount + 1
End If
Next rCell
GetColorCount = TotalCount
End Function
Cell F3 uses this function to count the coloured cells. It will not count conditionally formatted cells but I can format a cell manually with the sdame orange & it counts it. Help please!