![]() |
Entering a row everytime column C changes value
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. |
Entering a row everytime column C changes value
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 -- Don Guillett SalesAid Software "aashish" wrote in message ... 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. |
All times are GMT +1. The time now is 06:40 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com