Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveSheet.[AA2:AA65000].ClearContents 'on efface col Z
ActiveSheet.Range("$A$2:$AA" & [A65000].End(3).Row).AutoFilter Field:=27
If TextBox1 = "" Then GoTo fin
With Range("$A$3:$Z" & [A65000].End(3).Row)
Set c = .Find(TextBox1.Value, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Cells(c.Row, 27) = 1 'on écrit 1 si trouvé
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
fin:
Application.EnableEvents = True
Application.ScreenUpdating = True
If TextBox1 = "" Then Exit Sub
ActiveSheet.Range("$A$2:$AA$" & [A65000].End(3).Row).AutoFilter Field:=27, Criteria1:="<>" 'on filtre
End Sub