Just to clarify, use this code:
Code:Public Function InString(text As Variant, String1 As String) As Integer Dim y%, i%, imax%, j% If Len(String1) Then Exit Function For i = 1 To UBound(text) imax = i + 5000 If imax > UBound(text) Then imax = UBound(text) For j = i To imax y = y - CBool(InStr(1, text(j), String1)) Next i DoEvents Next i InString = y End Function




Reply With Quote