Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = &HD Then '&HD est la touche Enter
FonctionRecherche TextBox1.Value, "D:D"
End If
End Sub
Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = &HD Then '&HD est la touche Enter
FonctionRecherche TextBox2.Value, "E:E"
End If
End Sub
Sub FonctionRecherche(MaRecherche As String, col As String)
Dim rngTrouve As Range
Set rngTrouve = ActiveSheet.Columns(col).Cells.Find(What:=MaRecherche, LookAt:=xlPart)
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
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Cellule As Range
If Target.Column = 3 Then
If Target.Value <> "" Then
With Worksheets("Feuil1").Range("D34:BR47")
Set Cellule = .Find(What:=Target.Value, After:=Worksheets("Feuil1").Range("d34"), LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False)
If Cellule Is Nothing Then Exit Sub
Cancel = True
Application.Goto Cellule
End With
End If
End If
End Sub