Sub test()
Debug.Print TrieAlphaPasDoublon("9,11 ,9,8,9,7,8,1")
End Sub
Function TrieAlphaPasDoublon(Value As String) As String
Const adInteger = 3
Dim T, I As Integer: T = Split(Value & ",", ",")
With CreateObject("ADODB.Recordset")
.Fields.Append "KRY", adInteger
.Open
For I = LBound(T) To UBound(T) - 1
.Filter = "KRY=" & Trim(T(I))
If .EOF Then .AddNew "KRY", Trim(T(I))
Next
.Update
.Filter = ""
.MoveFirst
.Sort = "KRY"
TrieAlphaPasDoublon = .GetString(, , , ",")
TrieAlphaPasDoublon = Left(TrieAlphaPasDoublon, Len(TrieAlphaPasDoublon) - 1)
.Close
End With
End Function