|
Sub 测试()
Set dic = CreateObject("Scripting.Dictionary")
Sheet2.Activate
For i = 2 To Range("B" & Rows.Count).End(xlUp).Row
dic(Cells(i, 2).Value & "|" & Cells(i, 1).Value) = dic(Cells(i, 2).Value & "|" & Cells(i, 1).Value) + Cells(i, 3).Value
Next
Application.ScreenUpdating = False
For Each wkst In ThisWorkbook.Worksheets
If wkst.Name <> "数据" Then
ar = wkst.UsedRange.Value
For j = 3 To UBound(ar)
For k = 3 To UBound(ar, 2)
ar(j, k) = dic(ar(j, 2) & "|" & ar(1, k))
Next
Next
wkst.Range("A1").Resize(UBound(ar), UBound(ar, 2)) = ar
End If
Next
Set dic = Nothing
Application.ScreenUpdating = True
End Sub |
评分
-
1
查看全部评分
-
|