Hi all,
I found a really excellent function on the net that you guys might have seen before but that I wanted to share. This formula sums cells according to colour. Neat huh?
Robert
Code
Function SUMIFCOLOUR(TheRange As Range, TheColourCell As Range) As Variant
Dim TempRange As Range
Dim Result
Dim Colour
Application.Volatile
On Error GoTo BailOut
Colour = TheColourCell.Interior.Color
For Each TempRange In TheRange
If Colour = TempRange.Interior.Color Then Result = Result + TempRange.Value
Next
BailOut:
SUMIFCOLOUR = Result
End Function
Display More