SUM numbers of a certain font color
Give this a try. Where there is a named range you want to count the red
fonts is named DataY
Sub SumColorCountRed()
Dim Red3 As Integer
Dim Cell As Range
For Each Cell In Range("DataY")
If Cell.Font.ColorIndex = 3 Then
Red3 = Red3 + Cell.Value
End If
Next
Range("F1").Value = "Red = " & Red3
MsgBox " Red adds to " & Red3, _
vbOKOnly, "CountColor"
Range("F1").Value = ""
End Sub
HTH
Regards,
Howard
"gudencough" wrote in message
...
I am making a sheet of customers that have contracts to build objects. In
column A, there is a list of prices that are paid and not paid. The paid
items are formated in red font color. Column B is the amount we have paid
them.
Is there a way to formate colum B so that when i change a number to red in
column A, it will automatically update with the new SUM in colmn B?
Hopefully not too confusing.
|