The following is the function in which I used for the CCBC
Function</SPAN> GetCellColor(xlRange As</SPAN> Range) </SPAN>
Dim</SPAN> indRow, indColumn As</SPAN> Long</SPAN>
Dim</SPAN> arResults() </SPAN>
Application.Volatile </SPAN>
If</SPAN> xlRange Is</SPAN> Nothing</SPAN> Then</SPAN>
Set</SPAN> xlRange = Application.ThisCell </SPAN>
End</SPAN> If</SPAN>
If</SPAN> xlRange.Count > 1 Then</SPAN>
ReDim</SPAN> arResults(1 To</SPAN> xlRange.Rows.Count, 1 To</SPAN> xlRange.Columns.Count) </SPAN>
For</SPAN> indRow = 1 To</SPAN> xlRange.Rows.Count </SPAN>
For</SPAN> indColumn = 1 To</SPAN> xlRange.Columns.Count </SPAN>
arResults(indRow, indColumn) = xlRange(indRow, indColumn).Interior.Color </SPAN>
Next</SPAN>
Next</SPAN>
GetCellColor = arResults </SPAN>
Else</SPAN>
GetCellColor = xlRange.Interior.Color </SPAN>
End</SPAN> If</SPAN>
End</SPAN> Function</SPAN>
Function</SPAN> GetCellFontColor(xlRange As</SPAN> Range) </SPAN>
Dim</SPAN> indRow, indColumn As</SPAN> Long</SPAN>
Dim</SPAN> arResults() </SPAN>
Application.Volatile </SPAN>
If</SPAN> xlRange Is</SPAN> Nothing</SPAN> Then</SPAN>
Set</SPAN> xlRange = Application.ThisCell </SPAN>
End</SPAN> If</SPAN>
If</SPAN> xlRange.Count > 1 Then</SPAN>
ReDim</SPAN> arResults(1 To</SPAN> xlRange.Rows.Count, 1 To</SPAN> xlRange.Columns.Count) </SPAN>
For</SPAN> indRow = 1 To</SPAN> xlRange.Rows.Count </SPAN>
For</SPAN> indColumn = 1 To</SPAN> xlRange.Columns.Count </SPAN>
arResults(indRow, indColumn) = xlRange(indRow, indColumn).Font.Color </SPAN>
Next</SPAN>
Next</SPAN>
GetCellFontColor = arResults </SPAN>
Else</SPAN>
GetCellFontColor = xlRange.Font.Color </SPAN>
End</SPAN> If</SPAN>
End</SPAN> Function</SPAN>
Function</SPAN> CountCellsByColor(rData As</SPAN> Range, cellRefColor As</SPAN> Range) As</SPAN> Long</SPAN>
Dim</SPAN> indRefColor As</SPAN> Long</SPAN>
Dim</SPAN> cellCurrent As</SPAN> Range </SPAN>
Dim</SPAN> cntRes As</SPAN> Long</SPAN>
Application.Volatile </SPAN>
cntRes = 0 </SPAN>
indRefColor = cellRefColor.Cells(1, 1).Interior.Color </SPAN>
For</SPAN> Each</SPAN> cellCurrent In</SPAN> rData </SPAN>
If</SPAN> indRefColor = cellCurrent.Interior.Color Then</SPAN>
cntRes = cntRes + 1 </SPAN>
End</SPAN> If</SPAN>
Next</SPAN> cellCurrent </SPAN>
CountCellsByColor = cntRes </SPAN>
End</SPAN> Function</SPAN>
Function</SPAN> SumCellsByColor(rData As</SPAN> Range, cellRefColor As</SPAN> Range) </SPAN>
Dim</SPAN> indRefColor As</SPAN> Long</SPAN>
Dim</SPAN> cellCurrent As</SPAN> Range </SPAN>
Dim</SPAN> sumRes </SPAN>
Application.Volatile </SPAN>
sumRes = 0 </SPAN>
indRefColor = cellRefColor.Cells(1, 1).Interior.Color </SPAN>
For</SPAN> Each</SPAN> cellCurrent In</SPAN> rData </SPAN>
If</SPAN> indRefColor = cellCurrent.Interior.Color Then</SPAN>
sumRes = WorksheetFunction.Sum(cellCurrent, sumRes) </SPAN>
End</SPAN> If</SPAN>
Next</SPAN> cellCurrent </SPAN>
SumCellsByColor = sumRes </SPAN>
End</SPAN> Function</SPAN>
Function</SPAN> CountCellsByFontColor(rData As</SPAN> Range, cellRefColor As</SPAN> Range) As</SPAN> Long</SPAN>
Dim</SPAN> indRefColor As</SPAN> Long</SPAN>
Dim</SPAN> cellCurrent As</SPAN> Range </SPAN>
Dim</SPAN> cntRes As</SPAN> Long</SPAN>
Application.Volatile </SPAN>
cntRes = 0 </SPAN>
indRefColor = cellRefColor.Cells(1, 1).Font.Color </SPAN>
For</SPAN> Each</SPAN> cellCurrent In</SPAN> rData </SPAN>
If</SPAN> indRefColor = cellCurrent.Font.Color Then</SPAN>
cntRes = cntRes + 1 </SPAN>
End</SPAN> If</SPAN>
Next</SPAN> cellCurrent </SPAN>
CountCellsByFontColor = cntRes </SPAN>
End</SPAN> Function</SPAN>
Function</SPAN> SumCellsByFontColor(rData As</SPAN> Range, cellRefColor As</SPAN> Range) </SPAN>
Dim</SPAN> indRefColor As</SPAN> Long</SPAN>
Dim</SPAN> cellCurrent As</SPAN> Range </SPAN>
Dim</SPAN> sumRes </SPAN>
Application.Volatile </SPAN>
sumRes = 0 </SPAN>
indRefColor = cellRefColor.Cells(1, 1).Font.Color </SPAN>
For</SPAN> Each</SPAN> cellCurrent In</SPAN> rData </SPAN>
If</SPAN> indRefColor = cellCurrent.Font.Color Then</SPAN>
sumRes = WorksheetFunction.Sum(cellCurrent, sumRes) </SPAN>
End</SPAN> If</SPAN>
Next</SPAN> cellCurrent </SPAN>
SumCellsByFontColor = sumRes </SPAN>
End</SPAN> Function</SPAN>