I want to compare values from two columns at once and I created wrote this code: It not works, first of all the second for loop (x1) uses different cells, but my intention was to use a break to get out from the for -loop after each step. I tried with Exit For but is not working. Any idea how I could compare 2 cells from 2 columns at once (with 2 for loops or not)? Thanks!
For x2 = x2Row To 2 Step -1
For xl = xRow To 2 Step -1
If ((Cells(xl, xCol) = Cells(xl - 1, xCol)) And (Cells(x2, x2Col) = Cells(x2 - 1, x2Col))) Then
Cells(xl, xCol) = ""
End If
Next xl
Next x2