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