Private Sub CommandButton1_Click()
Dim i&, r As Range, p As Range
Set dico = CreateObject("scripting.dictionary")
With Feuil1.Range("E1:G" & Cells(Rows.Count, 6).End(xlUp).Row)
.AutoFilter Field:=2, Criteria1:="Val1"
Set p = .SpecialCells(xlVisible)
.AutoFilter
End With
With ListView1
For Each r In p.Rows
If Not dico.exists(Feuil1.Cells(r.Row + 1, "G").Value) Then
i = i + 1
.ListItems.Add , , Feuil1.Cells(r.Row + 1, "E") '<--- modifier l'instruction pour ajouter
.ListItems(i).ForeColor = RGB(0, 255, 255)
.ListItems(i).ListSubItems.Add , , Feuil1.Cells(r.Row + 1, "G")
.ListItems(i).ListSubItems(1).ForeColor = RGB(255, 0, 0)
End If
dico(Feuil1.Cells(r.Row + 1, "G").Value) = ""
Next
ListView1.Sorted = True
ListView1.SortKey = 1
End With
End Sub