0
Thanks

A few words of thanks would be greatly appreciated.

Count no. of Cell with particular color in a row/Column


Here i am defining a function for counting a no. of cell in a Row/Column with particular color,

It is just like Countif cellcolor is = Color

Function ColorCount(colorCell As Range, countRange As Range)   
Dim rCell As Range   
Dim cellCol As Integer   
Dim ans As Long   
ans = 0   
cellCol = colorCell.Interior.ColorIndex   
For Each rCell In countRange   
If rCell.Interior.ColorIndex = cellCol Then   
ans = ans + 1   
End If   
Next rCell   

ColorCount = ans   

End Function   
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Count no. of Cell with particular color in a row/Column », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).