heres UDF i came up with...its pretty specific to your example though
included the getbackground color UDF so you know where i get the random numbers from (which is colorindex)![]()
Function SumColor(MyRange As Range, Color As Long, Cat As String) Dim cell As Range For Each cell In MyRange If Cells(cell.Row, 1).Value = Cat Then If cell.Interior.ColorIndex = Color Then SumColor = SumColor + cell.Value End If End If Next End Function
Bookmarks