各位老师,可以看看我的贴吗?该怎么修改,
Sub Total()
Set d = CreateObject("scripting.dictionary")
Application.ScreenUpdating = False
arr = Sheets("系统导出").UsedRange
r = 0
For j = 1 To UBound(arr)
If arr(j, 9) = "金额" Then
If d.exists(arr(j, 9) & "") Then
X = d(arr(j, 9) & "")
arr(X, 6) = arr(X, 6) + arr(j, 6)
Else
r = r + 1
d(arr(j, 9) & "") = r
arr(r, 1) = arr(j, 1)
arr(r, 2) = arr(j, 2)
arr(r, 3) = arr(j, 3)
arr(r, 4) = arr(j, 8)
arr(r, 5) = arr(j, 7)
arr(r, 6) = arr(j, 9)
End If
End If
Next j
If r > 0 Then [A1].Resize(r, 6) = arr
Application.ScreenUpdating = True
End Sub |