10 Years of Service
15%
Please note, if you want to make a deal with this user, that it is blocked.
[HIDE-THANKS]Lo código _Full for study.
[/HIDE-THANKS]
Code:
>Private Function InStrCount(ByRef sSource As String, _
ByRef sFind As String, _
Optional ByRef eCmpMethod As VbCompareMethod = vbTextCompare) As Long
Dim sSourceCopy As String
Dim lFoundLoc As Long
InStrCount = 0
If (sSource = Empty) Or (sFind = Empty) Then Exit Function
sSourceCopy = sSource
lFoundLoc = 1000 'enter loop
While (lFoundLoc > 0)
lFoundLoc = InStr(1, sSourceCopy, sFind, eCmpMethod)
If (lFoundLoc > 0) Then
InStrCount = InStrCount + 1
'cut string from first occurrence
sSourceCopy = Mid(sSourceCopy, _
lFoundLoc + Len(sFind), _
Len(sSourceCopy))
End If
Wend
End Function