FindString




Public Function CountInStr(ByVal strString As String, ByVal strFind As String, _
Optional ByVal boolIgnoreCase As Boolean) As Integer
' Restituisce il numero di strFind esistenti

Dim i As Integer, intTemp As Integer
If boolIgnoreCase Then
' Setta i parametri stringa in lowercase

strString = LCase(strString)
strFind = LCase(strFind)
End If
Do
' Loop ricerca

i = InStr(i + 1, strString, strFind)
If i <> 0 Then intTemp = intTemp + 1
Loop While i <> 0
CountInStr = intTemp
End Function












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