Bonsoir à tous ,
Ma p'tite version VBA. Cliquez sur le bouton Hop!
le code dans la module de la feuille "Feuil1" :
Sub Reor()
Dim r, t, ref, n&, i&, j&
Application.ScreenUpdating = False
If Me.FilterMode Then Me.ShowAllData
Range("f1").CurrentRegion.Clear
With Intersect(Range("a1").CurrentRegion, Columns("a:c"))
r = .Value2
.Sort [a1], xlAscending, Header:=xlYes, MatchCase:=False
t = .Value2: .Value2 = r: ReDim r(1 To UBound(t), 1 To 1)
ref = "": n = 1: j = Columns("f:f").Column - 1
For i = 2 To UBound(t)
If t(i, 1) <> ref Then
If n > 1 Then j = j + 1: Cells(1, j).Resize(n) = r
n = 1: ref = t(i, 1): r(n, 1) = "SI " & t(i, 1)
End If
n = n + 1: r(n, 1) = t(i, 3)
Next i
If n > 1 Then j = j + 1: Cells(1, j).Resize(n) = r
Range(Range("f1"), Cells(1, j)).HorizontalAlignment = xlHAlignRight
Range(Range("f1"), Cells(1, j)).Font.Bold = True
Range(Range("f1"), Cells(1, j)).Interior.Color = RGB(250, 230, 255)
Range("f1").CurrentRegion.Borders.LineStyle = xlContinuous
Range(Range("f1"), Cells(1, j)).EntireColumn.AutoFit
End With
End Sub
...