Hi there,
I seem to need a little help with my loop. values and rows will change. I'm looking at values in column A, if the value is the same as the value below (A2 - A3) delete A2, if it is diferent then move to the cell below.
this is my code
Dim rCell as Range
Set Rngy = Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
For Each rCell In Rngy
If rCell.Value = rCell.Offset(1, 0).Value Then
rCell.EntireRow.Delete
ElseIf rCell.Value <> rCell.Offset(1, 0).Value Then
rCell.Offset(1, 0).Select
End If
Next
for some reason it only does the first line and then stops - what am I missing.
thanks in advance.
I seem to need a little help with my loop. values and rows will change. I'm looking at values in column A, if the value is the same as the value below (A2 - A3) delete A2, if it is diferent then move to the cell below.
this is my code
Dim rCell as Range
Set Rngy = Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
For Each rCell In Rngy
If rCell.Value = rCell.Offset(1, 0).Value Then
rCell.EntireRow.Delete
ElseIf rCell.Value <> rCell.Offset(1, 0).Value Then
rCell.Offset(1, 0).Select
End If
Next
for some reason it only does the first line and then stops - what am I missing.

thanks in advance.