Bonjour
Ci joint un fichier excell pour lequel j'essaie de construire une textbox de recherche situé dans l,onglet Bd
Voici mon code et en ROUGE et GRAS la ou ca bloque
Je joins le fichier evidememnt
Private Sub TextBox1_Change()
Dim ws As Worksheet
Dim lastrow As Long
Dim i As Long, j As Long
Dim searchText As String
Dim found As Boolean
Set ws = ThisWorkbook.Sheets("Base de données")
lastrow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
searchText = LCase(Me.TextBox1.Value)
If ws.AutoFilterMode Then
ws.AutoFilterMode = False
End If
If searchText = "" Then
ws.Rows.Hidden = False
Exit Sub
End If
For i = 3 To lastrow
found = False
For j = 1 To 13
' If InStr(1, LCase(ws.Cells(i, j).Value, searchText, vbTextCompare)>0 Then
found = True
Exit For
End If
ws.Rows(i).Hidden = Not found
Next i
End Sub