You are on page 1of 1

Function SUMARPORCOLOR(CeldaReferencia As Range, RangoSeleccion As Range) As Long

Dim celdaSeleccion As Range

For Each celdaSeleccion In RangoSeleccion


If celdaSeleccion.Interior.ColorIndex = CeldaReferencia.Interior.ColorIndex
Then
SUMARPORCOLOR = SUMARPORCOLOR + celdaSeleccion.Value
End If
Next

End Function

You might also like