Arkadaşlar koşullu renge göre toplama için aşağıdaki kodu kullanıyorum. Bu koda bir koşul daha eklemek istersem nasıl yaparım? Sumifs gibi çalışmasını istiyorum mantık olarak. Bir hücrenin rengine göre, sonrasında ise diğer sütundaki açıklamaya göre toplayacak.
Kod:
Function SumByColor(CellColor As Range, SumRange As Range)
Application.Volatile
Dim ICol As Integer
Dim TCell As Range
ICol = CellColor.Interior.ColorIndex
For Each TCell In SumRange
If ICol = TCell.Interior.ColorIndex Then
SumByColor = SumByColor + TCell.Value
End If
Next TCell
End Function
