|
- Sub 对比()
- Dim arr, brr, crr, i, j, d, r
- Set d = CreateObject("scripting.dictionary")
- arr = Sheet1.Range("a1").CurrentRegion
- brr = Sheet1.Range("e1").CurrentRegion
- ReDim crr(1 To UBound(arr), 1 To 3)
- For j = 2 To UBound(brr)
- s = brr(j, 1) & "|" & brr(j, 2)
- d(s) = d(s) + 1
- Next
- For i = 2 To UBound(arr)
- s = arr(i, 1) & "|" & arr(i, 2)
- If Not d.exists(s) Then
- For j = 1 To 3
- crr(n, j) = arr(i, j)
- Next
- End If
- Next
- Sheet1.[i:i].NumberFormatLocal = "@"
- Sheet1.[i3].Resize(1000, 3).ClearContents
- Sheet1.[i3].Resize(n, 3) = crr
- End Sub
复制代码 |
|