Sub EnLigne()
Dim a, t, i&, n&, s$, ref
Application.ScreenUpdating = False
[d1].CurrentRegion.Clear
a = [a1].CurrentRegion
[a1].CurrentRegion.Sort key1:=[a1], order1:=xlAscending, key2:=[b1], order2:=xlAscending, Header:=xlYes
t = [a1].CurrentRegion.Resize([a1].CurrentRegion.Rows.Count + 1)
[a1].CurrentRegion = a: Erase a
ref = t(1, 1): s = t(1, 1) & ";" & t(1, 2): n = 0
For i = 2 To UBound(t)
If t(i, 1) = ref Then
s = s & ";" & t(i, 2)
Else
n = n + 1
Cells(n, "d") = s
ref = t(i, 1): s = ref & ";" & t(i, 2)
End If
Next i
[d1].CurrentRegion.TextToColumns Semicolon:=True
[d1].CurrentRegion.Borders.LineStyle = xlContinuous
End Sub