With Feuil1
y = 1
fin = .Range("A" & Rows.Count).End(xlUp).row
aa = .Range("A2:W" & fin)
End With
For i = 1 To UBound(aa)
aa(i, 5) = i + 1
Next i
For i = 1 To UBound(aa)
For a = 1 To UBound(aa, 2)
If aa(i, a) Like "*" & Tnomrecherche & "*" Then aa(i, 6) = "oui": y = y + 1: Exit For
Next a
Next i
If y = 1 Then Exit Sub
If y = 1 Then
For i = 1 To UBound(aa)
If aa(i, 6) = "oui" Then
ListBox1.AddItem aa(i, 1)
For a = 1 To UBound(aa, 2) - 2
ListBox1.List(ListBox1.ListCount - 1, a - 1) = aa(i, a)
Controls(Tnomrecherche) = aa(i, a)
Next a
mem = 1: Exit For
End If
Next i
Else
ReDim bb(y - 1, UBound(aa, 2) - 1)
y = 1
For i = 1 To UBound(aa)
If aa(i, 6) = "oui" Then
For a = 1 To UBound(aa, 2) - 1
bb(y, a) = aa(i, a)
Next a
y = y + 1
End If
Next i
End If
With ListBox1
.ColumnCount = 22
.ColumnWidths = "20;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40"
If mem Then Exit Sub
.List = bb
End With