1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub Creer_Liste_SansDoublons()
Dim Plage As Range, Cell As Range
Dim Un As Collection
Dim i As Long, Ligne As Long
Set Un = New Collection
With Worksheets("Feuil1")
Set Plage = .Range(.Range("A1"), .Range("A" & Rows.Count).End(xlUp))
End With
On Error Resume Next
For Each Cell In Plage
If Cell <> "" Then Un.Add Cell, CStr(Cell)
Next Cell
On Error GoTo 0
With Worksheets("Feuil2")
For i = 1 To Un.Count
Ligne = Ligne + 1
Plage.Find(Un.Item(i), LookIn:=xlValues, lookat:=xlWhole).Resize(1, 2).Copy .Range("A" & Ligne)
Next i
End With
Set Plage = Nothing: Set Un = Nothing
End Sub |
Partager