Option Explicit
Dim texte
Private Sub CommandButton1_Click()
    Dim tbl, table As Range
    Set table = Range("Tableau1")
    ' si on a omis ou mis le 3e argument "vertical" a false  c'est un tableau transposé on utilise ".Column" et non ".list"
        ' sinon on utilise ".List"
      ' tbl = GetTableNoDouble(table, "prenom")    'en 2d argument soit l'index soit le nom de la colonne (dans le header)
    tbl = GetTableNoDouble(table, "nom", True)   'en 2d argument soit l'index soit le nom de la colonne (dans le header)
    With ListBox1
        .ColumnCount = table.Columns.Count
         ' si on a omis ou mis le 3e argument "vertical" a false  c'est un tableau transposé on utilise ".Column" et non ".list"
        ' sinon on utilise ".List"
        '.Column = tbl
        .List = tbl
        End With
    MsgBox texte
End Sub
Function GetTableNoDouble(rng As Range, Optional colMaitre As Variant = 1, Optional vertical As Boolean = False)
'utilisation d'une collection 'by Bruno45
    Dim a&, i&, Unique As New Collection, tbl(), tablo, c&, z
    tablo = rng.Value
    texte = "colonne controlée :colonne(""" & colMaitre & """)"""
    If Not IsNumeric(colMaitre) Then colMaitre = Range(rng.ListObject.Name).ListObject.ListColumns(colMaitre).Index
    On Error Resume Next
    For i = 1 To UBound(tablo)
        texte = texte & vbCrLf & tablo(i, colMaitre) & ";  "
        z = " ligne du tableau " & i & ":   non gardé"
        Unique.Add i, tablo(i, colMaitre)
        If Err.Number = 0 Then
            z = " ligne du tableau " & i & ":   gardé"
            'comme on redim preserve et que seul la derniere dimmension est redimentionnable alors on redim transposé
            a = a + 1: ReDim Preserve tbl(1 To UBound(tablo, 2), 1 To a)
            For c = 1 To UBound(tablo, 2): tbl(c, a) = tablo(i, c): Next
        Else
            Err.Clear
        End If
        texte = texte & z
    Next
    On Error GoTo 0
    If vertical Then tbl = Application.Transpose(tbl)
    GetTableNoDouble = tbl
End Function