|
原因が判らないのでどなたか助けてください。
以下の集計を行うと
Set dic = CreateObject("Scripting.Dictionary")
の箇所で
実行時エラー 429
activexコンポーネントはオブジェクトを作成できません
と表示され先に進めません。
解決方法おわかりの方がいれば教えてください。
Dim vnt, a
Dim dic As Object
'
With Sheets("作業A")
vnt = .Range("P2", .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, 16)) Then
ReDim a(17)
a(0) = vnt(i, 1)
a(1) = vnt(i, 2)
a(2) = vnt(i, 3)
a(3) = vnt(i, 4)
a(4) = vnt(i, 5)
a(5) = vnt(i, 6)
Else
a = dic(vnt(i, 16))
End If
a(6) = a(6) + vnt(i, 7)
a(7) = a(7) + vnt(i, 8)
a(8) = a(8) + vnt(i, 9)
a(9) = a(9) + vnt(i, 10)
a(10) = a(10) + vnt(i, 11)
a(11) = a(11) + vnt(i, 12)
a(12) = a(12) + vnt(i, 13)
a(13) = a(13) + vnt(i, 14)
a(14) = a(14) + vnt(i, 15)
a(15) = a(15) + vnt(i, 16)
dic(vnt(i, 16)) = a
Next i
'-----結果出力
With Sheets("作業")
.Cells.ClearContents
.Range("A1").Resize(, 16).Value = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15")
.Range("A2").Resize(dic.Count, 16).Value = Application _
.Transpose(Application.Transpose(dic.items))
.Select
End With
'
Erase vnt
Set dic = Nothing
|
|