Function doublon(TabD() As Integer, pos As Variant, pos2 As Variant)
For i = LBound(TabD, 1) To UBound(TabD, 1)
If i <= 6 Then
TabD(i, 1) = Cells(pos(0), pos(1) + i)
Else
TabD(i, 1) = Cells(pos(0) + 2, i - pos(1))
End If
Next i
i = Empty
' suppression des doubon
For i = LBound(TabD, 1) To UBound(TabD, 1)
For j = i + 1 To UBound(TabD, 1)
If TabD(i, 1) = TabD(j, 1) Then
TabD(i, 2) = "1"
End If
Next j
Next i
i = Empty
j = Empty
' restitution
Dim n As Integer
n = 1
Dim temp() As Integer
ReDim temp(1 To n)
For i = LBound(TabD, 1) To UBound(TabD, 1)
If TabD(i, 2) = 1 Then
If pos2(0) = 3 Then
Cells(pos2(0), pos2(1)) = TabD(i, 1)
pos2(1) = pos2(1) + 1
temp(n) = TabD(i, 1)
n = n + 1
ReDim Preserve temp(1 To n)
Else
Cells(pos2(0), pos2(1)) = TabD(i, 1)
pos2(1) = pos2(1) + 1
temp(n) = TabD(i, 1)
n = n + 1
ReDim Preserve temp(1 To n)
End If
End If
Next i
i = Empty
n = n - 1
ReDim Preserve temp(1 To n)
' fonction
' Tri
Call tri(temp, 1, n)
pos2(1) = 13
For i = LBound(temp, 1) To UBound(temp, 1)
Cells(pos2(0), pos2(1) + i) = temp(i)
Next i
End Function