J'étais aussi parti sur un dictionary, ça va beaucoup plus vite ! (environ 1 seconde)
Le problème banzai c'est que d'après le profil de notre ami amerig, il a excel 2011. Et excel 2011 est pour mac. Et mac ne gère pas le Dictionary me semble-t-il.
Le code que j'ai pondu avec des boucles en veux-tu en voilà :
Sub PdtParLigneDico()
Dim temp, temp2, temp3
Dim dico As Object
Dim i As Long, j&
Application.ScreenUpdating = False
Range("f2:g" & Range("f" & Rows.Count).End(xlUp).Row).Resize(, 2).ClearContents
Set dico = CreateObject("Scripting.Dictionary")
temp = Range("a2:c" & Range("a" & Rows.Count).End(xlUp).Row)
For i = LBound(temp) To UBound(temp)
dico(temp(i, 1)) = temp(i, 1)
Next i
temp2 = dico.keys
ReDim temp3(LBound(temp2) To UBound(temp2), 1 To 1)
For i = LBound(temp2) To UBound(temp2)
For j = LBound(temp) To UBound(temp)
If temp(j, 1) = temp2(i) Then temp3(i, 1) = temp3(i, 1) & "," & temp(j, 3)
Next j
Next i
For i = LBound(temp3) To UBound(temp3)
temp3(i, 1) = Mid(temp3(i, 1), 2, Len(temp3(i, 1)) - 1)
Next i
[f2].Resize(UBound(temp2) + 1, 1) = temp2
[g2].Resize(UBound(temp3) + 1, 1) = temp3
End Sub
Bonjour Tulipe, ta solution est-elle viable ? Car comment on fait pour les autres product id ?