Alors, là, je me suis juste fait plaisir !
Option Explicit
Sub comparer()
Dim Data1, Data2, dico As Object, dejafait As Object, i%, j%, k%, flag As Boolean, rng1 As Range, rng2 As Range, cle, debut As Date
Set dico = CreateObject("Scripting.Dictionary")
Set dejafait = CreateObject("Scripting.Dictionary")
debut = Now
raz
For i = 1 To Cells(1, Columns.Count).End(xlToLeft).Column - 1
If Not dejafait.exists(i) Then ' correspondance testée
Set rng1 = Range(Cells(1, i), Cells(Cells(Rows.Count, i).End(xlUp).Row, i))
Data1 = Range(Cells(1, i), Cells(Cells(Rows.Count, i).End(xlUp).Row, i)).Value
dico.RemoveAll
For k = LBound(Data1) To UBound(Data1)
dico(Data1(k, 1)) = ""
Next
For j = i + 1 To Cells(1, Columns.Count).End(xlToLeft).Column
Set rng2 = Range(Cells(1, j), Cells(Cells(Rows.Count, j).End(xlUp).Row, j))
Data2 = Range(Cells(1, j), Cells(Cells(Rows.Count, j).End(xlUp).Row, j)).Value
flag = True
If UBound(Data2) = UBound(Data1) Then
For k = LBound(Data2) To UBound(Data2)
If Not dico.exists(Data2(k, 1)) Then flag = False: Exit For
Next
If flag Then
Sheets("correspondances").Cells(i + 1, j + 1) = "ok"
If Not dejafait.exists(i) Then dejafait(i) = i: colorier rng1, i
dejafait(j) = i
colorier rng2, i
End If
End If
Next
Else ' correspondances déduites
For Each cle In dejafait
If dejafait(cle) = dejafait(i) And cle > i Then Sheets("correspondances").Cells(i + 1, cle + 1) = "(x)"
Next
End If
Next
With Sheets("groupes").ListObjects(1)
For Each cle In dejafait
.ListRows.Add
.DataBodyRange.Cells(.ListRows.Count, 1) = dejafait(cle)
.DataBodyRange.Cells(.ListRows.Count, 2) = cle
Next
End With
Sheets("synthèse groupes").PivotTables("Tableau croisé dynamique1").PivotCache.Refresh
MsgBox "Terminé en " & Format(Now - debut, "hh:mm:ss")
End Sub
Sub colorier(plage As Range, n As Integer)
Dim p, c
c = (n Mod 54) + 3 ' on évite le 2 (blanc)
p = Array(2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)
plage.Interior.ColorIndex = c
plage.Font.ColorIndex = p(c - 1)
End Sub
Sub raz()
Dim i%, j%
With Sheets("groupes").ListObjects(1)
If Not .DataBodyRange Is Nothing Then .DataBodyRange.Delete
End With
Sheets("données").Select
Cells.Interior.Pattern = xlNone
Cells.Font.ColorIndex = xlAutomatic
With Sheets("correspondances")
.Cells.ClearContents
.Cells(2, 1) = 1
.Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column + 1) = Cells(1, Columns.Count).End(xlToLeft).Column
For i = 1 To Cells(1, Columns.Count).End(xlToLeft).Column - 1
Sheets("correspondances").Cells(1, i + 1) = i
For j = i + 1 To Cells(1, Columns.Count).End(xlToLeft).Column
.Cells(j + 1, 1) = j
Next
Next
End With
End Sub