Private Sub Command1_Click()
If Text1 = "" Then Exit Sub
For i = 1 To Len(Text2)
If Mid(Text2, i, Len(Text1)) = Text1 Then
Text2.SelStart = i - 1
Text2.SelLength = Len(Text1)
Text2.SetFocus
Exit For
End If
Next
End Sub
上面的是text1 下面的是text2 按钮是command1