|
参与一下。。。
- Sub ykcbf() '//2024.7.29
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("出库查询")
- r = .Cells(Rows.Count, 3).End(3).Row
- zrr = .[a1].Resize(r, 7)
- For i = 3 To UBound(zrr)
- s = zrr(i, 2)
- d(s) = i
- Next
- End With
- With Sheets("扫码区")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 3)
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- If d.exists(s) Then
- arr(i, 2) = zrr(d(s), 3)
- arr(i, 3) = zrr(d(s), 4)
- End If
- Next
- .[a1].Resize(r, 3) = arr
- End With
- Set d = Nothing
- Application.ScreenUpdating = False
- MsgBox "OK!"
- End Sub
复制代码
|
|