Bonsoir à tous,
A tester :
Option Explicit
Sub test()
Dim i As Long, dico As Object
Set dico = CreateObject("Scripting.Dictionary")
With Sheets("Feuil1")
With .Cells(1).CurrentRegion
For i = 2 To .Rows.Count
If .Cells(i, 1).Value = .Cells(1, 10).Value Then
dico(.Cells(i, 2).Value) = VBA.Array(.Cells(i, 2).Value, .Cells(i, 3).Value)
End If
Next
End With
With .Cells(1, 11).CurrentRegion
With .Offset(1, 2)
.ClearContents
If dico.Count > 0 Then
.Resize(dico.Count, UBound(dico.items()(0)) + 1).Value = Application.Transpose(Application.Transpose(dico.items))
Else
MsgBox "aucune donnée"
End If
End With
End With
End With
Set dico = Nothing
End Sub
klin89