Add colored cell values in column

Closed
Rajiv - May 6, 2010 at 06:22 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 7, 2010 at 09:41 AM
i want to add cell values in a column which are of red font color.
for ex. i have a column a of range a1 to 10 and values are below and 20,50,70,100 are of red color font . I want to add only these values of red color i.e total should be shown 240 in cell B12
A B
10
20
30
40
50
60
70
80
90
100


3 replies

still waiting for ur favourable respond after writing appology and reactivate letter tosupport@facebook.com
0
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 767
May 6, 2010 at 07:09 AM
Are they red due to some conditional formatting or have been colored red. If due to conditional formatting, what is the condtion
0
no they are red by manually and there is no conditional formatting in the column.
0
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 767
May 7, 2010 at 09:41 AM
Paste this formula

Function MySum(mySumRange As Range) As Variant
Dim sum As Variant

    For Each cell In mySumRange
    
        If (cell.Font.color = RGB(255, 0, 0)) Then
            sum = sum + cell
        End If
    
    Next
    MySum = sum
    
End Function



and then in your cell B12 write

=MySum(A1:A10)
0