Counting coloured cells doesn't work with conditional formatting in Excel
问题 Trying to count the number of certain coloured cells on my worksheet using this peice of VBA code : Function CountRed(MyRange) CountRed = 0 For Each Cell In MyRange If Cell.Interior.Color = RGB(255, 0, 0) Then CountRed = CountRed + 1 End If Next Cell End Function Basically, counts the number of red cells. Now this works fine if I colour them myself but if i put conditional formatting in my worksheet to colour these cells it doesnt work. Here is my condition : =AND(NOT(ISBLANK(A3)),ISBLANK(D3)