View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Sum all Cells with Interior Color Index not equal to 0

One way:

First, 0 is not a valid value for Range.Interior.ColorIndex. I assume
you mean xlColorIndexNone instead.

For Each rCell In Range("F5:F" & LastRow)
With rCell
If IsNumeric(.Value) Then _
If .Interior.ColorIndex < xlColorIndexNone Then _
dResult = dResult + .Value
End With
Next rCell

In article ,
RyanH wrote:

I need to sum cells in Range("F5:F" & LastRow) that have a Interior Color
Index < 0. Is there an easy way to do this?

Thanks is Advance,
Ryan