Function CountChars(sFind, sString) As Integer
Dim x As Integer
Dim nTo As Integer
Dim nCount As Integer
For x = 1 To Len(sString)
nTo = InStr(x, sString, sFind)
If nTo = 0 Then nTo = Len(sString)
nCount = nCount + 1
x = nTo
If x >= Len(sString) Then
Exit For
End If
Next x
CountChars = nCount - 1
End Function
|