|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub Macro1()
'
' Dim i%, j%, arr, d As Object
Application.DisplayAlerts = False
'arr = [a1].CurrentRegion
arr = Sheet1.UsedRange
'或者
'n = [b65536].End(3).Row
'arr = Range("a1:ac" & n)
Set d = CreateObject("scripting.dictionary")
For i = 1 To UBound(arr)
d(arr(i, 2) & vbTab & arr(i, 3) & vbTab & arr(i, 29)) = d(arr(i, 2) & vbTab & arr(i, 3) & vbTab & arr(i, 29)) + arr(i, 27)
Next
Sheet2.Activate
[k1] = "合计"
[h1].Resize(d.Count) = WorksheetFunction.Transpose(d.keys)
[k1].Resize(d.Count) = WorksheetFunction.Transpose(d.items)
[h:h].TextToColumns [h1:j1]
Application.DisplayAlerts = True
'
End Sub
|
评分
-
1
查看全部评分
-
|