Sub Deletesies()
Application.ScreenUpdating = False
Application.DisplayStatusBar = True
Application.StatusBar = "Finding Minimum Values"
Dim cell As Range
Dim dict As Object
Set dict = CreateObject("scripting.dictionary")
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("I2:I" & LR)
.FormulaR1C1 = "=MIN(IF(R2C1:R" & LR & "C1=R[0]C[-8],R2C6:R" & LR & "C6))"
.FormulaArray = .FormulaR1C1
.Value = .Value
End With
For i = LR To 2 Step -1
If Cells(i, 6) <> Cells(i, 9) Then
Cells(i, 1).EntireRow.Delete
Else
If Not dict.exists(Cells(i, 1).Value) Then
dict.Add Cells(i, 1).Value, 0
Else
Cells(i, 1).EntireRow.Delete
End If
End If
Cells(i, 9).Clear
Application.StatusBar = Format((LR - i) / LR, "Percent") & " Row Removal Complete"
Next
Set dict = Nothing
Application.StatusBar = False
Application.ScreenUpdating = True
End Sub
Bookmarks