VBA计数器求助
’ 汇总并输出程序代码:
lastRow = Cells(Rows.Count, "C").End(xlUp).Row Set dict = CreateObject("Scripting.Dictionary") For i = 2 To lastRow branch = Cells(i, "C").Value sum = Cells(i, "O").Value If dict.Exists(branch) Then dict(branch)(0) = dict(branch)(0) + 1 dict(branch)(1) = dict(branch)(1) + sum Else dict(branch) = Array(1, sum) End If Next i
请问下, 为什么这里的“dict(branch)(0) = dict(branch)(0) + 1” 和 “ dict(branch)(1) = dict(branch)(1) + sum”并没有实现计数和累加功能??
[此贴子已经被作者于2023-8-7 17:28编辑过]