Option Base 1
Private Sub CommandButton1_Click()
Dim T() As Variant
On Error Resume Next
'effacer la recherche précédente
UserForm1.ListBox1.Clear
x = 1
'si le textbox est vide alors on sort
If TextBox1 = "" Then Exit Sub
'Avec la recherche sur la feuille :
With Sheets("feuil1")
Set C = .UsedRange.Find(TextBox1, LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
dcol = .Cells(C.Row, 256).End(xlToLeft).Column
Do
With UserForm1.ListBox1
.ColumnCount = dcol
ReDim Preserve T(dcol, x)
For i = 1 To dcol
T(i, x) = Sheets("feuil1").Cells(C.Row, i)
Next i
End With
Set C = .UsedRange.FindNext(C)
x = x + 1
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
End With
UserForm1.ListBox1.List = Application.Transpose(T)
End Sub