Sub Worksheet_Activate()
With Sheets("Feuil1")
DC = .Cells(1, .Columns.Count).End(xlToLeft).Column
tablo = .Range(.Cells(1, 1), .Cells(2, DC))
End With
Cells.Clear
ReDim T(1 To 3 * DC, 1 To 3 * DC): C = -2: L = 1
For i = 1 To UBound(tablo, 2)
If tablo(1, i) <> "" Then
C = C + 3: Classe = tablo(1, i): T(1, C) = Classe: T(L, C + 1) = tablo(2, i): tablo(1, i) = ""
For j = i + 1 To UBound(tablo, 2)
If tablo(1, j) = Classe Then L = L + 1: T(L, C + 1) = tablo(2, j): tablo(1, j) = "":
Next j
T(1, C + 2) = "---": L = 1
End If
Next i
T(1, C + 2) = "": [A1].Resize(UBound(T, 1), UBound(T, 2)) = T: Columns.AutoFit
End Sub