Option Explicit
Option Compare Text
'Permet de filtrer si l'on veut afficher client ou fournisseur
Private Sub ComboBox1_Change()
Application.ScreenUpdating = False
Dim DerniereLigne As Long
Dim f As Worksheet
Dim Derniecol As Byte
Dim Ligne As Long
Set f = Sheets("DONNEES")
Derniecol = f.Range("A" & f.Columns.Count).End(xlToLeft).Column
DerniereLigne = f.Range("A" & f.Rows.Count).End(xlUp).Row
With UserForm1
If .ComboBox1 = "" Then Exit Sub
With .ListBox_resultats
.Clear
For Ligne = 2 To DerniereLigne
If f.Cells(Ligne, 1) Like ComboBox1 Then
.AddItem f.Cells(Ligne, 2)
.List(.ListCount - 1, 1) = f.Cells(Ligne, 3)
.List(.ListCount - 1, 2) = f.Cells(Ligne, 4)
.List(.ListCount - 1, 3) = f.Cells(Ligne, 5)
.List(.ListCount - 1, 4) = f.Cells(Ligne, 6)
.List(.ListCount - 1, 5) = f.Cells(Ligne, 7)
.List(.ListCount - 1, 6) = f.Cells(Ligne, 8)
.List(.ListCount - 1, 7) = f.Cells(Ligne, 9)
.List(.ListCount - 1, 8) = f.Cells(Ligne, 10)
End If
Next
End With
End With
End Sub