Indsæt koden i et almindeligt modul
Function xSum(rng As Range, Farve As Double)
For Each c In rng
If c.Interior.ColorIndex = Farve Then xSum = xSum + c
Next
End Function
I cellen skriver du fx =xSum(B2:B13;-4142)
tallet -4142=ingen farve, skriv 14 hvis du vil summe de grønne celler