|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
猜一个吧。
- Sub ykcbf() '//2024.8.8
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("半成品出库查询")
- arr = .[a5].Resize(, 10)
- s = arr(1, 1)
- d(s) = ""
- End With
- With Sheets("扫码区")
- r = .Cells(Rows.Count, 1).End(3).Row
- For i = 2 To r
- s = .Cells(i, 1)
- If d.exists(s) Then
- For j = 2 To 4
- .Cells(i, j) = arr(1, j)
- Next
- End If
- Next
- r = .Cells(Rows.Count, "f").End(3).Row
- For i = 2 To r
- s = .Cells(i, "f")
- If d.exists(s) Then
- For j = 2 To 4
- .Cells(i, j + 5) = arr(1, j)
- Next
- End If
- Next
- End With
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
|