|
参与一下。。。- Sub ykcbf() '//2024.1.19
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("数据表")
- r = .Cells(.Rows.Count, "z").End(xlUp).Row
- arr = .[x1].Resize(r, 3)
- End With
- For i = 1 To UBound(arr)
- s = arr(i, 1) & "|" & CStr(arr(i, 2))
- d(s) = arr(i, 3)
- Next
- With Sheets("项目")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 3)
- For i = 2 To UBound(arr)
- s = arr(i, 3) & "|" & CStr(arr(i, 1))
- If d.Exists(s) Then
- arr(i, 2) = d(s)
- End If
- Next
- .[a1].Resize(r, 3) = arr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|