bonjour
2 propositions
Sub aargh()
Dim t As Variant
t = Array("a", "b", "f", "k", "b", "c", "q", "f", "u")
For i = 0 To UBound(t) - 1
For j = i + 1 To UBound(t)
If t(i) = t(j) Then t(j) = "": Z = Z & " " & t(i)
Next
Next
MsgBox Z 'liste valeurs avec doublons
For k = 0 To UBound(t)
If t(k) <> "" Then d = d & " " & t(k)
Next
MsgBox d 'liste des valeurs sans doublons
End Sub
Sub aargh1()
Dim t As Variant
Set dico = CreateObject("scripting.dictionary")
t = Array("a", "b", "f", "k", "b", "c", "q", "f", "u")
For i = 0 To UBound(t) - 1
If dico.exists(t(i)) Then Z = Z & " " & t(i) Else dico.Add t(i), 1
Next
MsgBox Z 'liste valeurs avec doublons
t = dico.keys
For k = 0 To UBound(t)
If t(k) <> "" Then d = d & " " & t(k)
Next
MsgBox d 'liste des valeurs sans doublons
End Sub