Private Sub UserForm_Initialize()
With ActiveSheet
Dim Cell As Range
'LstView pour Trier
For Each Cell In .Range("O2:O" & [O65000].End(xlUp).Row).SpecialCells(xlCellTypeVisible)
ListView1.ListItems.Add = Cell
Next
'liste triée sans doublon
For vLi = 1 To ListView1.ListItems.Count
ComboBox1 = ListView1.ListItems(vLi)
If ComboBox1.ListIndex = -1 Then ComboBox1.AddItem ListView1.ListItems(vLi)
Next
ListView1.ListItems.Clear
ComboBox1 = ""
End With
End Sub
Private Sub ComboBox1_Click()
With ActiveSheet
Dim Plage As Range, Est, Add As String, vLi As Integer, Vcol As Byte
End With
With ListBox1
.Clear
.ColumnCount = 6
.ColumnWidths = "100;100;200;200;90"
Set Plage = ActiveSheet.Range("O2:O" & [O65000].End(xlUp).Row)
Set Est = Plage.Find(ComboBox1)
If Not Est Is Nothing Then
Add = Est.Address
Do
.AddItem Cells(Est.Row, 1)
For Vcol = 2 To 6
.List(vLi, Vcol - 1) = Cells(Est.Row, Vcol)
Next
vLi = vLi + 1
Set Est = Plage.FindNext(Est)
Loop While Not Est Is Nothing And Est.Address <> Add
End If
End With
End Sub