| 
    
     |  | 見よう見まねでScripting.Dictionaryを利用したのですが 全く別シートに表示されません。
 
 対象データを範囲指定を利用して処理する最後の行数を取得
 しているのですがうまくいきません。
 
 どなたか教えて下さい。
 御願いします。
 
 KEYにしているのは名前です。(文字列)
 加算するのは、金額です。
 
 Dim i As Long
 
 Dim vnt, a
 Dim dic As Object
 
 With Sheets("作業")
 vnt = .Range("M1", .Range("A65536").End(xlUp)).Value
 End With
 
 Set dic = CreateObject("Scripting.Dictionary")
 For i = 1 To UBound(vnt, 1)
 If Not dic.exists(vnt(i, 13)) Then
 ReDim a(2)
 a(0) = vnt(i, 13)
 Else
 a = dic(vnt(i, 13))
 End If
 a(1) = a(1) + vnt(i, 11)
 dic(vnt(i, 13)) = a
 Next i
 
 '-----結果出力
 With Sheets("集計")
 .Cells.ClearContents
 .Range("A1").Resize(, 2).Value = Array("仕入先名称", "仕入金額")
 
 .Range("A2").Resize(dic.Count, 2).Value = Application _
 .Transpose(Application.Transpose(dic.items))
 .Select
 End With
 '
 Erase vnt
 Set dic = Nothing
 
 
 |  |