View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Adding cells in a range based on format color

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


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