Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Editing code to insert two rows

Excel Experts,

I have the following code that goes through a column of data in row C,
starting from the bottom of the row, and inserts ONE blank row each time the
data in cells in Column C changes.

Sub InsertRow()

For i = Cells(Rows.Count, "c").End(xlUp).Row To 1 Step -1
If Cells(i - 1, "c") < Cells(i, "c") Then Rows(i).Insert

Next i

End Sub



How would I modify this code to insert TWO blank rows each time the data in
column C changes.

Thanks,
Alan






--
achidsey
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Editing code to insert two rows

Sub InsertRow()
For i = Cells(Rows.Count, "c").End(xlUp).Row To 2 Step -1
If Cells(i - 1, "c") < Cells(i, "c") Then Range(Rows(i), Rows(i).Offset(1, 0)).Rows.Insert
Next i
End Sub


Kind Regards.
"achidsey" (notmorespam), haber iletisinde şunları ...
Excel Experts,

I have the following code that goes through a column of data in row C,
starting from the bottom of the row, and inserts ONE blank row each time the
data in cells in Column C changes.

Sub InsertRow()

For i = Cells(Rows.Count, "c").End(xlUp).Row To 1 Step -1
If Cells(i - 1, "c") < Cells(i, "c") Then Rows(i).Insert

Next i

End Sub



How would I modify this code to insert TWO blank rows each time the data in
column C changes.

Thanks,
Alan






--
achidsey



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
Editing VB Code with VB Simon Shaw Excel Programming 2 July 25th 05 07:41 PM
Insert Character into Editing-Cell MJ Excel Programming 2 July 13th 05 02:45 AM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM
Editing code Todd Huttenswtine Excel Programming 3 December 29th 03 06:18 AM
Help with some code to insert rows Gareth[_3_] Excel Programming 2 December 11th 03 10:10 PM


All times are GMT +1. The time now is 05:17 PM.

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"