|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf() '//2024.9.1
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("表1")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 3)
- End With
- For i = 2 To UBound(arr)
- s = arr(i, 3)
- d(s) = arr(i, 2)
- Next
- With Sheets("表2")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 3)
- For i = 2 To UBound(arr)
- s = arr(i, 2)
- If d.Exists(s) Then arr(i, 3) = d(s) Else arr(i, 3) = ""
- Next
- .[c1].Resize(r, 1) = Application.Index(arr, 0, 3)
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
2
查看全部评分
-
|