Sub s() arr = [a1].CurrentRegion Set d = CreateObject("scripting.dictionary") For i = 2 To UBound(arr) d(arr(i, 2)) = d(arr(i, 2)) + arr(i, 3) Next [e1].Resize(d.Count) = Application.Transpose(d.keys) [f1].Resize(d.Count) = Application.Transpose(d.items) End Sub |
|