Option Compare Text
Private Sub TextBox1_Change()
Dim datas, pl As Range, lig As Long, lig1 As Long, mot As String
Application.ScreenUpdating = False
If Sheets("Collection").TextBox1.Value <> "" Then
datas = Range("Tableau14").Value
lig1 = Range("Tableau14").Row
mot = TextBox1.Value & "*"
For lig = 1 To UBound(datas)
If Not Rows(lig + lig1 - 1).Hidden Then
If Not (datas(lig, 1) Like mot Or datas(lig, 3) Like mot Or datas(lig, 5) Like mot) Then
If pl Is Nothing Then Set pl = Rows(lig + lig1 - 1) Else Set pl = Union(pl, Rows(lig + lig1 - 1))
End If
End If
If Not pl Is Nothing Then
If pl.Areas.Count > 10 Then pl.EntireRow.Hidden = True: Set pl = Nothing
End If
Next lig
If Not pl Is Nothing Then pl.EntireRow.Hidden = True
Set pl = Nothing
End If
Application.ScreenUpdating = True
End Sub
Private Sub TextBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
'On supprime le text du champs au clic sur le champs
With TextBox1
.Text = ""
.SelStart = 0
.SelLength = Len(.Text)
End With
Range("Tableau14").EntireRow.Hidden = False
End Sub