CountItem




Function Tally(sText As String, sFind As String) As Long
Dim lFind As Long
Dim lLast As Long
Do
lFind = InStr(lLast + 1, sText, sFind)
If lFind Then
lLast = lFind
Tally = Tally + 1
End If
Loop Until lFind = 0
End Function

A simple loop through your main string lets you count the
occurrences of a specified character or string.
This function is useful for determining if enough commas
appear in your comma-delimited string:










( countitem.html )- by Paolo Puglisi - Modifica del 17/12/2023