bonjour,
Je ne souhaite pas regrouper tout ensemble mais bien suivre l'ordre qui est en place
dans ce cas il suffit d'enlever l'instruction de tri
Sub aargh()
Dim tabr()
With Sheets("base")
dl = .Cells(Rows.Count, 1).End(xlUp).Row
Sheets("resultat").Cells.ClearContents
.Range("A1").Resize(dl, 2).Copy Sheets("resultat").Range("A1")
End With
With Sheets("resultat")
'.Range("A1").Resize(dl, 2).Sort key1:=.Range("A1"), order1:=xlAscending, key2:=.Range("B1"), order2:=xlAscending, Header:=xlNo
ReDim tabr(1 To dl, 1 To 2)
pt = 0
vp = ""
For i = 1 To dl
If .Cells(i, 1) = vp Then
tabr(pt, 2) = tabr(pt, 2) & "-" & .Cells(i, 2)
Else
pt = pt + 1
tabr(pt, 1) = .Cells(i, 1)
tabr(pt, 2) = .Cells(i, 2)
vp = .Cells(i, 1)
End If
Next i
.Cells.ClearContents
.Range("A1").Resize(pt, 2) = tabr
End With
End Sub