Q:

VBA Delete entire row if value in 1 column is greater than the value in another column

I am new to VBA for excel and I am stuck with a little problem. I have to delete an entire row if the value in column D is greater than the value in column E.
The list of data is very long and I will need the action to continue until the data in column C ends. Any help would be great!

A:

When deleting rows, start at the bottom and work up or you may skip rows due to the renumbering associated with a newly deleted row.
Sub del_D_greater_than_E()
    Dim rw As Long

    With Worksheets("Sheet5")   '<~~ set this properly!
        For rw = .Cells(Rows.Count, "C").End(xlUp).Row To 2 Step -1
            If .Cells(rw, "D").Value2 > .Cells(rw, "E").Value2 Then
                .Rows(rw).EntireRow.Delete
            End If
        Next rw
    End With

End Sub

That should be enough to get you started. You may want to turn off screen updating and calculation during the operation.

