Gruppe
UDF
Problem
In einem anzugebenden Bereich sind alle Zellen mit einer vorgegebenen Hintergrundfarbe zu zählen.
StandardModule: Modul1
Function CountColor(rng As Range, iColor As Integer)
Dim rngAct As Range
Dim iCount As Integer
For Each rngAct In rng.Cells
If rngAct.Interior.ColorIndex = iColor And _
Not IsEmpty(rngAct) Then
iCount = iCount + 1
End If
Next rngAct
CountColor = iCount
End Function