ich möchte gern die ROTEN Zellen in der Spalt 2 zählen,
habe so eingefärbt: Selection.Interior.ColorIndex = 38
mfg Walter mb
Sub Rote_Zellen_Zählen()
Call FARBEZÄHLEN
End Sub
Function FARBEZÄHLEN(Bereich As Range, Farbe As Byte) As Long
Dim c As Range
For Each c In Bereich
If c.Interior.ColorIndex = 36 Then
FARBEZÄHLEN = FARBEZÄHLEN + 1
End If
Application.Volatile (True)
Next c
End Function
mfg Walter mb
Sub Rote_Zellen_Zählen()
MsgBox FARBEZÄHLEN(Range("A1:A100"), 38)
End Sub
Function FARBEZÄHLEN(Bereich As Range, Farbe As Byte) As Long
Dim c As Range
For Each c In Bereich
If c.Interior.ColorIndex = Farbe Then
FARBEZÄHLEN = FARBEZÄHLEN + 1
End If
Next c
End Function
Gruß
Rudi
Eine Kuh macht Muh, viele Kühe machen Mühe