Код: Выделить всё
Function sumRangeColor(iObrazets, iDiapazon) As Double
iColor = iObrazets.Interior.ColorIndex
For Each iCell In iDiapazon
If iCell.Interior.ColorIndex = iColor Then
If IsNumeric(iCell) = True Then
sumRangeColor = sumRangeColor + iCell
End If
End If
Next
End Function