請測試看看,謝謝
Sub test()
Dim Arr, xD, T$, i&
Set xD = CreateObject("Scripting.Dictionary")
Arr = Sheets("數據").[a1].CurrentRegion
For i = 2 To UBound(Arr): T = Arr(i, 1): xD(T) = Arr(i, 2): Next
With Sheets("工作表比對")
Arr = .[b1].CurrentRegion
For i = 2 To UBound(Arr): T = Arr(i, 1): Arr(i, 2) = xD(T): Next
.[b1].Resize(UBound(Arr), 2) = Arr
End With
End Sub作者: dou10801 時間: 2022-1-24 13:33