1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
Private Sub SupprimerDouble()
Dim tEntree As Variant: tEntree = Array("a", "b", "c", "d", "e", "e", "f", "a", "b", "t", "e")
Dim tSortie() As String: ReDim tSortie(0)
Dim trouve As Boolean
Dim i As Integer
Dim j As Integer
For i = LBound(tEntree) To UBound(tEntree)
trouve = False
If Not IsNull(tSortie) Then
For j = LBound(tSortie()) To UBound(tSortie())
If tEntree(i) = tSortie(j) Then
trouve = True
Exit For
End If
Next j
End If
If Not trouve Then
If i <> LBound(tEntree) Then
ReDim Preserve tSortie(UBound(tSortie) + 1)
End If
tSortie(UBound(tSortie)) = tEntree(i)
End If
Next i
Debug.Print Join(tSortie, ",")
End Sub |
Partager