Sub test1()
Dim MyString As String, MyPosition As Integer
MyString = "cdfghajkl"
MyPosition = Application.WorksheetFunction.Find("a", MyString, 1)
a = MsgBox(MyPosition, , "Thong Bao")
End Sub
Sub test2()
Dim MyString, TargetString As String, MyPosition, MyLenth As Integer
MyString = "cdfghajkl"
TargetString = "ha"
Lenth1 = Len(MyString)
Lenth2 = Len(TargetString)
'-----------------------------------------------------------------------------
For i = 1 To Lenth1
If Mid(MyString, i, Lenth2) = TargetString Then
MyPosition = i
a = MsgBox(MyPosition, , "Thong Bao")
Exit For
End If
Next i
End Sub