LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Macro To Insert Blank Row?


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

"rtidrtid" wrote in
message ...

anyone a dab hand at Excel? I need a had creating a macro. What i have
is a column with numbers, for example

12222
12222
21111
21111
13333
13333

what i need is a macro which will insert a blank row after an identical
sequence of numbers, turning the above into

12222
12222

21111
21111

13333
13333


any ideas?


--
rtidrtid
------------------------------------------------------------------------
rtidrtid's Profile:
http://www.excelforum.com/member.php...o&userid=31148
View this thread: http://www.excelforum.com/showthread...hreadid=508130



 
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
Macro to insert blank lines Terry Pinnell Excel Discussion (Misc queries) 6 October 21st 05 11:21 PM
Insert Row macro not working Acct Supr - DCTC Excel Discussion (Misc queries) 3 October 7th 05 01:11 AM
Activate a macro to insert a row and copy the formuals from the rows above to the blank row oil_driller Excel Discussion (Misc queries) 1 February 11th 05 03:30 PM
How to insert a Macro within a macro? Thrava Excel Discussion (Misc queries) 3 February 8th 05 01:10 AM
Inserting Blank Rows Macro? Michael Saffer Excel Worksheet Functions 2 November 9th 04 06:23 PM


All times are GMT +1. The time now is 02:34 PM.

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"