M Mo Sep 30, 2003 #1 Would anyone like to tell me how it would be possible to add only the cells that are colored e.g. red through a range Mo
Would anyone like to tell me how it would be possible to add only the cells that are colored e.g. red through a range Mo
M merjet Sep 30, 2003 #2 Would anyone like to tell me how it would be possible to add only the cells that are colored e.g. red through a range Click to expand... Function SumRed(Target As Range) As Integer Dim c As Range For Each c In Target If c.Interior.ColorIndex = 3 Then SumRed = SumRed + 1 Next c End Function HTH, Merjet
Would anyone like to tell me how it would be possible to add only the cells that are colored e.g. red through a range Click to expand... Function SumRed(Target As Range) As Integer Dim c As Range For Each c In Target If c.Interior.ColorIndex = 3 Then SumRed = SumRed + 1 Next c End Function HTH, Merjet
C Chip Pearson Sep 30, 2003 #3 Mo, You need to use a VBA procedure to do this. See the SumByColor function at www.cpearson.com/excel/colors.htm .
Mo, You need to use a VBA procedure to do this. See the SumByColor function at www.cpearson.com/excel/colors.htm .
M merjet Sep 30, 2003 #4 If c.Interior.ColorIndex = 3 Then SumRed = SumRed + 1 That should have been: If c.Interior.ColorIndex = 3 Then SumRed = SumRed + c Merjet
If c.Interior.ColorIndex = 3 Then SumRed = SumRed + 1 That should have been: If c.Interior.ColorIndex = 3 Then SumRed = SumRed + c Merjet