- Sub Macro1()
- Dim arr, brr, d, i&, zf$, s&
- Set d = CreateObject("scripting.dictionary")
- Sheet1.Activate
- arr = Range("a1").CurrentRegion
- brr = Sheet2.Range("a1").CurrentRegion
- For i = 1 To UBound(arr)
- zf = Join(Application.Index(arr, i, 0), ",")
- d(zf) = ""
- Next
- s = UBound(arr)
- For i = 1 To UBound(brr)
- zf = Join(Application.Index(brr, i, 0), ",")
- If Not d.Exists(zf) Then s = s + 1: Sheet2.Cells(i, 1).Resize(1, UBound(brr, 2)).Copy Cells(s, 1)
- Next
- End Sub
复制代码 |