Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Adding rows within a list

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nihad - 22 Feb 2006 16:38 GMT
I have a long list with no spaces, all in one column.  I am trying to
add 7 blank lines in between each row.  What is the easiest way to
achieve this?

Thanks in advance

Signature

nihad

BadgerMK - 22 Feb 2006 16:59 GMT
Hi

Try the following (I named my list Test)

Dim r As Object
Dim intCount As Integer
intCount = 1

For Each r In Range("Test")
If r.Value = "" Then

Else
r.Offset(1, 0).Select
intCount = 1
Do Until intCount > 7
Selection.EntireRow.Insert
intCount = intCount + 1
Loop
End If

Next
Ron de Bruin - 22 Feb 2006 17:05 GMT
Hi nihad

Try this macro

Sub test()
   Application.ScreenUpdating = False
   Dim R As Long
   Dim rng As Range
   Set rng = ActiveSheet.UsedRange
   For R = rng.Rows.Count To 1 Step -1
       rng.Rows(R + 1).Resize(7).EntireRow.insert
   Next R
   Application.ScreenUpdating = True
End Sub

Signature

Regards Ron de Bruin
http://www.rondebruin.nl

> I have a long list with no spaces, all in one column.  I am trying to
> add 7 blank lines in between each row.  What is the easiest way to
> achieve this?
>
> Thanks in advance
Ardus Petus - 22 Feb 2006 17:13 GMT
Sub SpaceSeven()
Dim irow As Long
For irow = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
   Rows(irow).Resize(7).Insert shift:=xlDown
Next irow
End Sub

HTH

--
AP

> I have a long list with no spaces, all in one column.  I am trying to
> add 7 blank lines in between each row.  What is the easiest way to
> achieve this?
>
> Thanks in advance
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.