Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
aashish
 
Posts: n/a
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Entering Same Formula to A Full Staring from Say Row 5 Column..... Dermot Excel Worksheet Functions 4 November 16th 05 09:56 AM
How to group similar column titles together???? vrk1 Excel Discussion (Misc queries) 2 April 30th 05 12:17 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 11:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"