|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf() '//2024.7.28
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set sh = ThisWorkbook.Sheets("1")
- For Each sht In Sheets
- If sht.Name <> sh.Name Then
- With sht
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 2)
- End With
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- d(s) = arr(i, 2)
- Next
- End If
- Next
- With sh
- 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, 3) = d(s)
- End If
- Next
- .[c1].Resize(r, 1) = Application.Index(arr, 0, 3)
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|