依據附件檔案內容需求如下,請測試看看,謝謝。
Sub tt()
Dim xD, Arr, sht%, i&, T
Set xD = CreateObject("Scripting.Dictionary")
For sht = 1 To 2
With Sheets(sht)
Arr = .Range(.[D2], .[A65536].End(3))
For i = 2 To UBound(Arr)
T = Arr(i, 1) & Arr(i, 2)
xD(T & "") = Array(Arr(i, 1), Arr(i, 2), Arr(i, 3), Arr(i, 4))
Next
End With
Next
[sheet3!A3].Resize(xD.Count, 4) = Application.Transpose(Application.Transpose(xD.items))
End Sub作者: s13030029 時間: 2021-3-25 17:48