|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 汇总一下()
Range("B3:E10000").Clear
Dim wb As Workbook
Dim k
Set wb = Workbooks.Open(ThisWorkbook.Path & "\总表.xlsx")
arr = Range("a1").CurrentRegion
wb.Close
h = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To UBound(arr)
For t = 2 To UBound(arr, 2)
On Error Resume Next
k = Range("B2:E2").Find(arr(1, t), , , xlWhole).Column
For j = 3 To h
If Cells(j, 1) = arr(i, 1) Then
Cells(j, k) = Cells(j, k) + arr(i, t)
End If
Next
k = ""
Next
Next
End Sub
经增加数据量,加入重复项,测试通过 |
评分
-
1
查看全部评分
-
|