Hello All,
I used a macro count the number of colored or formatted cells in a columns
Function CountColorIf(bArea As Range) As Long
Dim bAreacell As Range
Dim fillcolor As Long
Dim colorcount As Long
colorcount=0
For Each bAreacell In bArea
If bAreacell.Interior.Color <>XlNone Then
colorcount = colorcount + 1
End If
Next bAreacell
CountColorIf = colorcount
End Function
However when I run this formula it returns the count of entire selected columns in a row rathern than the colored or that has any formatting in it.
Can someone help me fix this code ?
Thanks,
Shyam
Bookmarks