|
参与一下。。。
- Sub ykcbf() '//2024.6.16
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("总档")
- r = .Cells(Rows.count, "b").End(xlUp).Row
- arr = .[a1].Resize(r, 8)
- End With
- For i = 3 To UBound(arr)
- s = arr(i, 2)
- d(s) = d(s) + arr(i, 8)
- Next
- With Sheets("物料清单")
- r = .Cells(.Rows.count, "b").End(xlUp).Row
- arr = .[a1].Resize(r, 2)
- For i = 2 To UBound(arr)
- s = arr(i, 2)
- If d.Exists(s) Then
- arr(i, 1) = d(s)
- End If
- Next
- .[a1].Resize(r, 2) = arr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
3
查看全部评分
-
|