Gruppe
UDF
Problem
Wie kann ich die Häufigkeit des Vorkommens eins bestimmten Zeichens in einer Zelle oder einem Bereich ermitteln?
StandardModule: basMain
Function HowMuch(rng As Range, strText As String)
Dim rngAct As Range
Dim var As Variant
Dim iCounter As Integer
Application.Volatile
For Each rngAct In rng.Cells
var = rngAct.Value
iCounter = iCounter + Len(var) - _
Len(Application.Substitute(var, strText, ""))
Next rngAct
HowMuch = iCounter
End Function