Adjust
Sub test()
Dim x As Range, i As Long, txt As String, temp As Range
Const mySerial As Long = 1
Const myOpNum As Long = 2
Const myDate As Long = 4
Dim dic As Object
Set dic = CreateObject("Scripting.Dictionary")
Application.ScreenUpdating = False
With Range("a2").CurrentRegion
For i = 2 To .Rows.Count
txt = Join$(Array(.Cells(i, mySerial).Value, .Cells(i, myOpNum).Value), Chr(2))
If Not dic.exists(txt) Then
Set dic(txt) = .Rows(i)
Else
If .Cells(i, myDate).Value >= dic(txt).Cells(myDate).Value Then
Set temp = dic(txt)
Set dic(txt) = .Rows(i)
Else
Set temp = .Rows(i)
End If
If x Is Nothing Then
Set x = temp
Else
Set x = Union(x, temp)
End If
End If
Next
End With
If Not x Is Nothing Then x.EntireRow.Delete
Application.ScreenUpdating = True
Set x = Nothing
Set dic = Nothing
End Sub
Bookmarks