Bonjour Nyfa, bonjour le forum,
Essaie comme ça :
Dim TV As Variant
Dim D As Object
Dim I As Integer
Dim J As Integer
Dim K As Integer
Dim COL As Byte
Dim TL() As Variant
Set OA = Worksheets("Agents")
Set OS = Worksheets("Service")
TV = OA.Range("A1").CurrentRegion
Set D = CreateObject("Scripting.Dictionary")
For I = 2 To UBound(TV, 1)
D(TV(I, 2)) = ""
Next I
tmp = D.Keys
For J = 0 To UBound(tmp)
K = 1: Erase TL
COL = OS.Rows(1).Find(tmp(J), , xlValues, xlWhole).Column
For I = 2 To UBound(TV, 1)
If TV(I, 2) = tmp(J) Then
ReDim Preserve TL(1 To K)
TL(K) = TV(I, 1)
K = K + 1
End If
Next I
OS.Cells(2, COL).Resize(UBound(TL), 1) = Application.Transpose(TL)
Next J
End Sub
Plus le temps de commenter le code mais si tu en as besoin n'hésite pas...