VBA function to sum Cell which contain cell and text based on cell backgound color. (this is a combination from 2 VBA from the web)
Function CountCcolor(range_data As Range, Criteria As Range) As Double
Dim datax As Range
Dim xcolor As Double
xcolor = Criteria.Interior.ColorIndex
CountCcolor = 0
For Each datax In range_data
If datax.Interior.ColorIndex = xcolor Then
CountCcolor = CountCcolor + Val(datax)
End If
Next datax
End Function
Function CountCcolor(range_data As Range, Criteria As Range) As Double
Dim datax As Range
Dim xcolor As Double
xcolor = Criteria.Interior.ColorIndex
CountCcolor = 0
For Each datax In range_data
If datax.Interior.ColorIndex = xcolor Then
CountCcolor = CountCcolor + Val(datax)
End If
Next datax
End Function