Weiss vielleicht "ransi" oder jemand anderer Bescheid?
Code meiner Funktion: https://www.herber.de/bbs/user/23655.txt
Vielen Dank vom Bodensee (Schweizerseite)
Indalo
Function SummeFarbe(Bereich As Object) As Double
Dim s As Double
Dim a As Object
Application.Volatile
s = 0
For Each a In Bereich
If a.Interior.ColorIndex > 0 Or a.Interior.ColorIndex < 57 Then
If IsNumeric(a.Value) Then
s = s + a.Value
End If
End If
Next
SummeFarbe = s
End Function
Function Farbsumme(Bereich As Range, Farbe As Integer)
Application.Volatile
Dim Zelle
Farbsumme = 0
For Each Zelle In Bereich
If Zelle.Interior.ColorIndex = Farbe Then
Farbsumme = Farbsumme + 1
End If
Next
End
Function
Gruß
Harald
Sub Farbsumme()
Dim n
Dim i As Integer
n = 0
For i = 2 To 172 'Zeilennummer anpassen
If Cells(i, 1).Interior.ColorIndex > 0 Then
n = n + Cells(i, 1).Value
End If
Cells(178, 1) = n
Next i
End Sub