Предполагая, что вопрос на самом деле касается VBA, вы можете использовать InStr (FullText, SearchedText), чтобы получить позицию первой искомой текстовой строки в строке.
Sub LambHunting()
A = "mary has a little lamb"
B = "mary has a little lamb mary has a little lamb mary has a little lamb..."
C = "Mary HAD a little lamb; unfortunately mary has a little lamb no longer."
Debug.Print "'" & A & "' is at position #" & InStr(B, A) & " in the string '" & B & "'"
Debug.Print "'" & A & "' is at position #" & InStr(C, A) & " in the string '" & C & "'"
End Sub
Возвраты:
'mary has a little lamb' is at position #1 in the string 'mary has a little lamb mary has a little lamb mary has a little lamb...'
'mary has a little lamb' is at position #39 in the string 'Mary HAD a little lamb; unfortunately mary has a little lamb no longer.'