|
Sub smt()
Dim d As Object, rng As Range
Dim ar, i&
Set d = CreateObject("scripting.dictionary")
Set rng = Nothing
ar = Sheet5.[a1].CurrentRegion
For i = 1 To UBound(ar)
s = ar(i, 4) & ar(i, 17) & ar(i, 18)
If d.exists(s) Then
If rng Is Nothing Then
Set rng = Cells(i, 4)
Else
Set rng = Union(rng, Cells(i, 4))
End If
Else
d(s) = ""
End If
Next
If Not rng Is Nothing Then rng.EntireRow.Delete
End Sub
Sub smt()
Dim d As Object, rng As Range
Dim ar, i&
Set d = CreateObject("scripting.dictionary")
Set rng = Nothing
ar = Sheet5.[a1].CurrentRegion
For i = 1 To UBound(ar)
s = ar(i, 4) & ar(i, 17) & ar(i, 18)
If d.exists(s) Then
If rng Is Nothing Then Set rng = Cells(i, 4)
Else
Set rng = Union(rng, Cells(i, 4))
End If
Else
d(s) = ""
End If
Next
If Not rng Is Nothing Then rng.EntireRow.Delete
End Sub
|
|