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: 2,836
Default Insert two lines each time a value in Column L changes

I am trying to get Excel to insert two lines each time a value in Column L
changes. My code is below:

Dim rngB As Range
Set rngB = Range("L2")
While rngB.Value < ""
If rngB.Value < rngB.Offset(1).Value Then
rngB.Offset(1).Resize(2).EntireRow.Insert
Set rngB = rngB.Offset(1)
End If
Set rngB = rngB.Offset(1)
Wend

It works the first time, but then fails afterwards. Is this one of those
instances where you have to start from the bottom of the list and work up? I
though working from the bottom up was only necessary for deleting rows based
on some criteria, such as deleting rows with blanks.

Any suggestions?

Thanks a lot!!
Ryan--

--
RyGuy
 
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
Insert Lines RENEE Excel Worksheet Functions 7 May 7th 10 07:59 PM
Insert lines in more than one worksheet at a time... Marvin Excel Worksheet Functions 3 August 22nd 07 08:36 PM
insert lines abunge Excel Discussion (Misc queries) 3 June 5th 06 09:02 AM
Insert lines when x< y teresa Excel Programming 2 December 5th 04 09:44 PM
how to automatically insert blank lines in between non-blank lines No Name Excel Programming 2 November 17th 03 03:40 PM


All times are GMT +1. The time now is 11:09 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"