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: 8
Default Inserting Blank Lines in Selection

Hi

I'm having a brain fade and can't figure out how to insert blank rows in a
selection without corrupting the selection and returning a Run Time error
424: Object Required.

The text data is from a csv file and is all pasted in Col A. I want to force
a blank line between each variable length record. Each new record starts
with an alpha/numeric string contained in square parentheses.

The abstract of the code I have currently is as follows:

Range("A1").Select
Range(ActiveCell, Selection.End(xlDown)).Select
For Each c In Selection
If Left(c.Value, 1) = "[" And c.Offset(-1, 0).Value < "" Then
c.Insert.Row
End If
Next c

The multiple If/And condition on line 4 is needed because some records
already have a blank row separating them. I just want to insert a single
blank row between the records that are not already separated.

Any suggestions would be greatly appreciated.

Thanks

Garry Douglas

** Please Remove SPMOFF to 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
Inserting numerous blank lines between specific rows of data Deb Excel Discussion (Misc queries) 5 December 22nd 09 05:01 PM
Macro not recognizing blank lines as blank pm Excel Discussion (Misc queries) 9 May 22nd 07 04:16 PM
Inserting Lines or Copying lines with formulas but without data wnfisba Excel Discussion (Misc queries) 2 August 18th 06 04:41 PM
how to automatically insert blank lines in between non-blank lines No Name Excel Programming 2 November 17th 03 03:40 PM
Inserting Lines C[_2_] Excel Programming 3 October 3rd 03 10:44 PM


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