|
参与一下。。。- Sub ykcbf() '//2024.3.4
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("Sheet1")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- End With
- For i = 2 To UBound(arr)
- For j = 3 To UBound(arr, 2)
- s = Left(arr(i, 1), 6) & "|" & arr(1, j)
- d(s) = d(s) + arr(i, j)
- Next
- Next
- t = d.items
- With Sheets("Sheet2")
- arr = .UsedRange
- For i = 2 To UBound(arr)
- For j = 2 To UBound(arr, 2)
- s = arr(i, 1) & "|" & arr(1, j)
- If d.Exists(s) Then
- arr(i, j) = d(s)
- End If
- Next
- Next
- .UsedRange = arr
- .UsedRange.Borders.LineStyle = 1
- ActiveWindow.DisplayZeros = False
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|