|
- Sub 删除()
- Dim arr, i&, j&, x, d, rng
- Set d = CreateObject("scripting.dictionary")
- With Sheets(2)
- arr = .[a1].CurrentRegion
- For i = 2 To UBound(arr)
- x = arr(i, 1) & arr(i, 5): d(x) = ""
- Next
- End With
- With Sheets(1)
- arr = .[a1].CurrentRegion
- Set rng = .Cells(UBound(arr) + 1, 1)
- For i = 2 To UBound(arr)
- x = arr(i, 1) & arr(i, 9)
- If d.exists(x) Then
- Set rng = Union(rng, .Cells(i, 1))
- End If
- Next
- rng.EntireRow.Delete
- End With
- End Sub
复制代码 |
|