Guarda quest'esempio:
codice:Dim StrRicerca As String Dim Inizio As Integer Text1.Text = "sdkfjsdjkfjk Bla bla " StrRicerca = InputBox("Inserire la stringa da ricercare", "Ricerca") Inizio = InStr(((Text1.SelStart + 1) + Text1.SelLength), Text1.Text, StrRicerca) - 1 If Inizio > -1 Then Text1.SelStart = Inizio Text1.SelLength = Len(StrRicerca) Text1.SetFocus Else Text1.SelStart = 0 Text1.SelLength = 0 End If

Rispondi quotando