I have to delete all rows that have to cells equal in VBA excel. Here is what i wrote:
Dim i As Long, j As Long
j = Rows.Count
For i = 1 To j
If Cells(i, 17).Value = Cells(i, 19).Value Then Rows(i).Delete
Next i
But this code is not deleting every line I am looking for. If there are 2 rows with matches the conditions respectively, Excel jumps to another one and leaves this (which is logical), I do not know how to adapt this loop to coming back and delete every searched line
For i = j To 1 Step -1