| 
    
     |  | ▼初心者です。 さん: 
 >KEYにしているのは名前です。(文字列)
 >加算するのは、金額です。
 
 ということでしたら、名前の列をDicのキーに
 金額の列を DicのItemにセットしていけばいい訳だから、
 Itemに 配列変数a を格納する必要はないですよね?
 
 Sub てすと2()
 Dim i As Long
 Dim v
 Dim dic As Object
 Const M = 13                '仕入先列 (M列)
 
 With Sheets("作業")             'K列〜M列 を配列に
 v = .Range(.Cells(1, M - 2), _
 .Cells(.Rows.Count, M).End(xlUp)).Value
 End With
 
 Set dic = CreateObject("Scripting.Dictionary")
 For i = 1 To UBound(v, 1)
 dic(v(i, 3)) = dic(v(i, 3)) + v(i, 1)  '仕入先別集計
 Next i
 
 '-----結果出力
 With Sheets("集計")
 .UsedRange.ClearContents
 .Range("A1").Resize(, 2).Value = Array("仕入先名称", "仕入金額")
 .Range("A2").Resize(dic.Count, 2).Value = _
 Application.Transpose(Array(dic.Keys, dic.Items))
 .Select
 End With
 '
 Erase v
 Set dic = Nothing
 
 End Sub
 
 |  |