Sub TriTabMult(Tbl, Optional ColTri1, Optional Coltri2, Optional Coltri3, Optional Coltri4, Optional Coltri5, Optional Coltri6, Optional Coltri7)
If IsMissing(ColTri1) Then ColTri1 = 1
Dim clé(): ReDim clé(LBound(Tbl) To UBound(Tbl))
Dim idx() As Long: ReDim idx(LBound(Tbl) To UBound(Tbl))
Dim b(): ReDim b(LBound(Tbl) To UBound(Tbl), LBound(Tbl, 2) To UBound(Tbl, 2))
If Not IsEmpty(Tbl(1, ColTri1)) And (IsNumeric(Tbl(1, ColTri1)) Or IsDate(Tbl(1, ColTri1))) Then tri1 = "num"
If Not IsMissing(Coltri2) Then If Not IsEmpty(Tbl(1, Coltri2)) And (IsNumeric(Tbl(1, Coltri2)) Or IsDate(Tbl(1, Coltri2))) Then trix2 = "num"
If Not IsMissing(Coltri3) Then If Not IsEmpty(Tbl(1, Coltri3)) And (IsNumeric(Tbl(1, Coltri3)) Or IsDate(Tbl(1, Coltri3))) Then tri3 = "num"
If Not IsMissing(Coltri4) Then If Not IsEmpty(Tbl(1, Coltri4)) And (IsNumeric(Tbl(1, Coltri4)) Or IsDate(Tbl(1, Coltri4))) Then tri4 = "num"
If Not IsMissing(Coltri5) Then If Not IsEmpty(Tbl(1, Coltri5)) And (IsNumeric(Tbl(1, Coltri5)) Or IsDate(Tbl(1, Coltri5))) Then tri5 = "num"
If Not IsMissing(Coltri6) Then If Not IsEmpty(Tbl(1, Coltri6)) And (IsNumeric(Tbl(1, Coltri6)) Or IsDate(Tbl(1, Coltri6))) Then tri6 = "num"
If Not IsMissing(Coltri7) Then If Not IsEmpty(Tbl(1, Coltri7)) And (IsNumeric(Tbl(1, Coltri7)) Or IsDate(Tbl(1, Coltri7))) Then tri7 = "num"
For i = LBound(Tbl) To UBound(Tbl)
If tri1 = "num" Then col1 = Format(Tbl(i, ColTri1), "0000000") Else col1 = Tbl(i, ColTri1)
If Not IsMissing(Coltri2) Then
If trix2 = "num" Then col2 = Format(Tbl(i, Coltri2), "0000000") Else col2 = Tbl(i, Coltri2)
Else
col2 = ""
End If
If Not IsMissing(Coltri3) Then
If tri3 = "num" Then col3 = Format(Tbl(i, Coltri3), "0000000") Else col3 = Tbl(i, Coltri3)
Else
col3 = ""
End If
If Not IsMissing(Coltri4) Then
If tri4 = "num" Then col4 = Format(Tbl(i, Coltri4), "0000000") Else col4 = Tbl(i, Coltri4)
Else
col4 = ""
End If
If Not IsMissing(Coltri5) Then
If tri5 = "num" Then col5 = Format(Tbl(i, Coltri5), "0000000") Else col5 = Tbl(i, Coltri5)
Else
col5 = ""
End If
If Not IsMissing(Coltri6) Then
If tri6 = "num" Then col6 = Format(Tbl(i, Coltri6), "0000000") Else col6 = Tbl(i, Coltri6)
Else
col6 = ""
End If
If Not IsMissing(Coltri7) Then
If tri7 = "num" Then col7 = Format(Tbl(i, Coltri7), "0000000") Else col7 = Tbl(i, Coltri7)
Else
col7 = ""
End If
clé(i) = col1 & "_" & col2 & "_" & col3 & "_" & col4 & "_" & col5 & "_" & col6 & "_" & col7
idx(i) = i
Next i
Call QuickI(clé(), idx(), LBound(clé), UBound(clé))
For lig = LBound(clé) To UBound(clé)
For col = LBound(Tbl, 2) To UBound(Tbl, 2): b(lig, col) = Tbl(idx(lig), col): Next col
Next lig
For lig = LBound(clé) To UBound(clé)
For col = LBound(Tbl, 2) To UBound(Tbl, 2): Tbl(lig, col) = b(lig, col): Next col
Next lig
End Sub