Private Sub UserForm_Activate()
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
On Error Resume Next
Me.ImageList1.ListImages.Add , "A" & i - 1, Application.CommandBars.GetImageMso(Cells(i, 1).Text, 40, 40)
If Err.Number > 0 Then
Err.Clear
Me.ImageList1.ListImages.Add , "A" & i - 1, Application.CommandBars.GetImageMso(Cells(2, 1).Text, 40, 40)
End If
Next
With ListView1
.SmallIcons = ImageList1 'association de la liste d image a la listview
With .ColumnHeaders: .Clear: .Add , , "icon", 150: End With
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row - 1
.ListItems.Add , , Cells(i + 1, 1).Text
.ListItems(i).SmallIcon = "A" & i
Next
.View = 3
End With
End Sub