LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Inserting Entire Rows

Hi,

Would somebody be able to help me?
I have a excel spreadsheet and wanted a macro that would insert an
entire row everytime the number above it in column C was different.
eg.

A B C
1 10 1 20
2 11 3 20
3 12 21 30 < Insert Row
4 13 27 30
5 14 11 40 < Insert Row


So far this is the only code i can write but it wont work:

Dim i As Integer
i = 2
While Range("C" & i) < ""
Do
If Range("C" & i) < Range("C" & i + 1) Then
Rows(i & ":" & i + 1).Insert Shift:=xlDown
i = i + 1
End If
i = i + 1
Loop
Wend

End Sub



Would anybody be able to assist me?

TP
 
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
inserting rows inbetween rows of data ? Azeem Excel Discussion (Misc queries) 1 October 27th 09 07:38 AM
Copying & Inserting Rows w/o Affecting other Rows Etc. LRay67 Excel Worksheet Functions 1 October 22nd 08 02:10 AM
inserting rows in entire sheet add Excel Discussion (Misc queries) 1 March 30th 07 04:10 PM
Inserting Blank rows after every row upto 2500 rows Manju Excel Worksheet Functions 8 August 22nd 06 12:54 PM
Deleting entire rows Ed C[_3_] Excel Programming 2 June 18th 04 02:14 PM


All times are GMT +1. The time now is 07:24 AM.

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

About Us

"It's about Microsoft Excel"