I am trying to build a simple macro that will compare two cells and if the values are the same it will delete that row, the code I am working from so far:
It's not deleting all the rows that have the same values. Any suggestions?
Code:
Sub CompareRowsandDelete()
Dim i As Long
For i = 3 To 358
If Range("O" & i) = Range("Q" & i) Then
Cells(i).EntireRow.Delete
End If
Next i
End Sub
It's not deleting all the rows that have the same values. Any suggestions?