How to count the cells in excel with different fill pattern styles
Hi
I want to count the cells in excel with different fill pattern styles.
How is it possible. Can anyone post the function for this purpose like counting coloured cells.
I tried a lot , but I got failed.
Here I got a function to count cells filled solid, but it is not working... is it correct??
Function CountCellpattern(CellPat As Range, rSumRange As Range)
Dim rCell As Range
Dim iPat As Integer
Dim vResult
iPat = CellPat.Interior.Pattern
For Each rCell In rSumRange
If iPat = 1 Then
vResult = vResult + 1
End If
Next rCell
CountCellpattern = vResult
End Function