I am trying to write a macro that removes rows that have a value less
than -1 in all columns C, D, E but I loose all the rows that have a
negative value (even if it is between 0 and -1) in all the three columns.
E.g. If I have a row:
idnumber idname -1.1 -0.3 -2.9
It is removed even though the value -0.3 is not less then -1?
Here is my code, can anyone please help me to explain/show how to do
this properly?
Sub RemoveBG()
totalrows = ActiveSheet.UsedRange.Rows.Count
For Row = totalrows To 1 Step -1
If (Cells(Row, 3).Value < -1 And Cells(Row, 4).Value < -1 And
Cells(Row, 5).Value < -1) Then
Rows(Row).Delete
End If
Next Row
End Sub