Entering a row everytime column C changes value

A

aashish

I need help creating a macro that will insert a row everytime a value in
column C does not equal the one before it. My data set can be 1000+ rows, so
doing this manually is a bit mind-numbing. I could also set up may data so
that a 0 or 1 is indicated every row that needs to have a row inserted.

thanks in advance.
 
D

Don Guillett

try this. the key is working from the bottom up instead of the top down.

Sub insertrowifnotminusonerow()
lr = Cells(Rows.Count, "c").End(xlUp).Row
For i = lr To 2 Step -1
If Cells(i - 1, "c") <> Cells(i, "c") Then Rows(i).Insert
Next i
End Sub
 
Top