Private Sub CommandButton1_click()
Dim i&, aa, bb, a&, y&, x&
ListBox1.Clear: Label2 = ""
With Sheets("Base")
aa = .Range("B10:Q" & .Range("B" & Rows.Count).End(xlUp).Row)
y = 1
For i = 1 To UBound(aa)
aa(i, 15) = i + 9
Next i
For i = 1 To UBound(aa)
If aa(i, 1) Like "*" & TextBox1 & "*" Or aa(i, 2) Like "*" & TextBox1 & "*" Then aa(i, 16) = "oui": y = y + 1
Next i
If y = 1 Then Exit Sub
ReDim bb(y - 1, 10): x = 1: y = 1
For i = 1 To UBound(aa)
If aa(i, 16) = "oui" Then
For a = 1 To UBound(bb, 2)
If a = 8 Then x = 10
If a = 9 Then x = 14
bb(y, a) = aa(i, x): x = x + 1
Next a
y = y + 1: x = 1
End If
Next i
With ListBox1
.ColumnCount = 9
.Clear
.List = bb
End With
End With
If UBound(bb) = 1 Then Label2 = "Ta recherche a trouvée " & UBound(bb) & " ligne"
If UBound(bb) > 1 Then Label2 = "Ta recherche a trouvée " & UBound(bb) & " lignes"
End Sub