codice:
Private Sub cmd_cerca_Click()
Dim i As Integer
Dim testo As String
Dim ricerca As String
Dim n As Integer
Dim l As Integer
Dim trovato As Boolean

ricerca = txt_ricerca.Text
testo = txt_testo.Text

n = Len(testo)
l = Len(ricerca)

trovato = False
Do
    For i = 1 To n
        If (ricerca = Mid(testo, i, l)) Then
            trovato = True
            exit do
        End If
    Next i
Loop Until (trovato = True Or i > n)

txt_testo.SelStart = i - 1
txt_testo.SelLength = l

If trovato = True Then
    MsgBox ("Trovato")
Else
    MsgBox ("Non trovato")
End If
        
End Sub
Devi anche impostare la proprietà HideSelection di txt_testo a false.