Lorsque j'applique ce code et que j'effectue une recherche, seule la première colonne s'affiche.
Or je souhaiterais que toute la ligne s'affiche (4 colonnes). Voici mon code actuel, avec quelques modifs depuis la dernière fois :
Private Sub TextBox1_Change()
Dim L As Integer
Dim O As Worksheet 'déclare la variable O (Onglet)
Dim TS As ListObject 'déclare la variable TS (Tableau Structuré)
Dim I As Integer
Set O = Worksheets("Source") 'définit l'onglet O
Set TS = O.ListObjects("Source") 'définit le tableau TS
ListBox1.Clear
If TextBox1 <> "" Then
For I = 1 To TS.ListRows.Count
If UCase(TS.DataBodyRange(I, 1).Value) Like "*" & UCase(TextBox1) & "*" Then
ListBox1.AddItem TS.DataBodyRange(I, 1).Value '====> Le problème doit venir de cette ligne mais je ne sais pas comment la modifier, malgré plusieurs tentatives...
For L = 0 To Me.ListBox1.ListCount - 1
Me.ListBox1.List(L, 3) = Format(Me.ListBox1.List(L, 3), "### ### ### €")
Next L
End If
Next I
ElseIf TextBox1 = "" Then
Set O = Worksheets("Source") 'définit l'onglet O
Set TS = O.ListObjects("Source") 'définit le tableau TS
Me.ListBox1.ColumnCount = 4
Me.ListBox1.List = TS.DataBodyRange.Value 'alimente la ListBox1
For L = 0 To Me.ListBox1.ListCount - 1
Me.ListBox1.List(L, 3) = Format(Me.ListBox1.List(L, 3), "### ### ### €")
Next L
End If
End Sub
Merci d'avance !