|
参与一下。。。
- Sub ykcbf() '//2024.12.10
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- For Each sht In Sheets
- If InStr(sht.Name, "AM") Then
- With sht
- r = .Cells(Rows.Count, 2).End(3).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c).Value
- End With
- For i = 5 To UBound(arr)
- For j = 6 To UBound(arr, 2)
- s = arr(i, 2) & "|" & arr(3, j)
- d(s) = d(s) + Val(arr(i, j))
- Next
- Next
- End If
- Next
- With Sheets("汇总")
- r = .Cells(Rows.Count, 1).End(3).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c).Value
- For i = 5 To UBound(arr)
- For j = 5 To UBound(arr, 2)
- s = arr(i, 1) & "|" & arr(3, j)
- If d.exists(s) Then
- .Cells(i, j).Value = d(s)
- Else
- .Cells(i, j).Value = ""
- End If
- Next
- Next
- ActiveWindow.DisplayZeros = False
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|