Option Explicit
Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = &HD Then '&HD est la touche Enter
mamacro TextBox1.Value, "A:A"
End If
End Sub
Private Sub TextBox2_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = &HD Then '&HD est la touche Enter
mamacro TextBox2.Value, "B:B"
End If
End Sub
Sub mamacro(MaChaine As String, col As String)
Dim rngTrouve As Range
Set rngTrouve = ActiveSheet.Columns(col).Cells.Find(what:=MaChaine)
If rngTrouve Is Nothing Then
MsgBox "L'objet saisi n'a pas été trouvé, vérifiez l'orthographe."
Else
rngTrouve.Activate
End If
Set rngTrouve = Nothing
End Sub