When I use this code...
Posted by Meredith L on January 09, 2002 2:11 PM
What I am trying to do is insert lines wherever the values in a column differ. I will eventually expand this code. The problem is that my For X number changes as the rows get inserted. So, if initially, the number of rows in the region is 50, and the code winds up inserting 5 rows, the evaluation equation stops at row 50, when it should not continue on to row 55.
The main question is "is there a way to 'reset' the For X number in midstream?
For x = 1 To (Sheets("Data Input").Range("c16").CurrentRegion.Rows.Count)
If Cells(x, 3).Value <> Cells(x + 1, 3).Value Then
Cells(x + 1, 3).EntireRow.Insert
x = x + 1