Bonjour,
Il semble que Patrick t'ait perdu de vue... !
Puisque tu semblais satisfait, je n'avais pas poursuivi... je reprends donc, mais où j'en étais, en regroupant les références par caractéristique...
Sub RegroupRef()
Dim Caract(), d As Object, k, n%, i%, j%, w%
Set d = CreateObject("Scripting.Dictionary")
With Worksheets("Feuil1")
n = .Cells(.Rows.Count, 1).End(xlUp).Row
For i = 2 To n
k = .Cells(i, 2)
d(k) = d(k) & ";" & .Cells(i, 1)
Next i
End With
n = d.Count: ReDim Caract(n, 0)
For Each k In d.keys
j = j + 1: Caract(j, 0) = k
Next k
For i = 1 To n - 1
For j = i + 1 To n
If Caract(j, 0) < Caract(i, 0) Then
Caract(0, 0) = Caract(j, 0)
Caract(j, 0) = Caract(i, 0)
Caract(i, 0) = Caract(0, 0)
End If
Next j
Next i
Caract(0, 0) = "Caractéristique"
For i = 1 To n
k = Split(d(Caract(i, 0)), ";")
If w < UBound(k) Then w = UBound(k): ReDim Preserve Caract(n, w)
For j = 1 To UBound(k)
Caract(i, j) = k(j)
Next j
Next i
Caract(0, 1) = "Ref"
With Worksheets("Feuil2")
.UsedRange.Clear
With .Range("A1").Resize(n + 1, w + 1)
.Value = Caract
.WrapText = True
.Rows(1).HorizontalAlignment = xlCenter
.Columns(1).ColumnWidth = 15
.Cells(1, 2).Resize(, w).Merge
End With
.Activate
End With
End Sub
Cordialement.