1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Option Compare Text
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
Application.ScreenUpdating = False
Range("B3:B40").Interior.ColorIndex = 2
For ligne = 3 To 40
If Cells(ligne, 2) Like "*" & TextBox1 & "*" Then
Cells(ligne, 2).Interior.ColorIndex = 43
ActiveSheet.Cells(ligne, 2).Select
ActiveWindow.ScrollRow = Selection.Row / 2
End If
Next
MsgBox ("Aucun résultat ne correspond à votre recherche !"), vbOKOnly + vbCritical, "RECHERCHE INTROUVABLE"
End If
End Sub |
Partager