| 
    
     |  | 教えて下さい。 WINDOWS-XP EXCEL2000の環境で処理しています。
 
 概要は、
 EXCELのセルの項目を利用してセルAとセルBを計算して
 金額を計算しその後、事前セットしたKEY項目別に合計金額
 を一覧に表示しようとしています。
 
 その際に、a(1) = a(1) + vnt(i, 33) の箇所
 で型が一致しませんと表示されるのですが
 回避方法を教えて下さい。
 
 以下に情報を記載します。
 
 KEY=セル34
 合計する項目=セル33 になります。
 
 どなたかアドバイスお願いします。
 
 
 '●条件編集用コピー
 
 Dim i As Long
 
 i = 1
 
 Do While Cells(i, 1) <> ""
 
 Cells(i, 30).Select
 ActiveCell.FormulaR1C1 = "=RC[-11]"
 
 Cells(i, 31).Select
 ActiveCell.FormulaR1C1 = "=RC[-14]"
 
 Cells(i, 32).Select
 ActiveCell.FormulaR1C1 = "=MID(RC[-25],1,6)"
 
 Cells(i, 33).Select
 ActiveCell.FormulaR1C1 = "=RC[-10]*RC[-22]"
 
 Cells(i, 34).Select
 ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-13],RC[-4],RC[-3],RC[-2])"
 
 
 i = i + 1
 
 Loop
 
 
 '●別シートに集計内容出力(集計)
 
 Dim vnt, a
 Dim dic As Object
 
 
 With Sheets("作業1")
 vnt = .Range("AI2", .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, 34)) Then
 ReDim a(1)
 a(0) = vnt(i, 34)
 Else
 a = dic(vnt(i, 34))
 End If
 a(1) = a(1) + vnt(i, 33)  ★!!!
 dic(vnt(i, 34)) = a
 Next i
 
 '-----結果出力
 With Sheets("集計")
 '.Cells.ClearContents
 .Range("A1").Resize(, 2).Value = Array("KEY", "金額合計")
 
 .Range("A2").Resize(dic.Count, 2).Value = Application _
 .Transpose(Application.Transpose(dic.items))
 .Select
 End With
 '
 Erase vnt
 Set dic = Nothing
 
 
 
 
 |  |