Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Chicago
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    adding mulitple multiple rows (xp)

    I have a worksheet with data in columns A through H and down to row ~2000.
    Is there a way to insert four empty rows under each existing row of data?
    Thanks much

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: adding mulitple multiple rows (xp)

    Try the code below. This code assumes that column A has something in the last row.

    <code>
    Public Sub Insert4Rows()
    Dim I As Long
    For I = Range("A65535").End(xlUp).Row - 1 To 1 Step -1
    Range(Range("A1").Offset(I, 0), Range("A1").Offset(I + 3, 0)).EntireRow.Insert
    Next I
    End Sub
    </code>
    Legare Coleman

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: adding mulitple multiple rows (xp)

    Try this macro:

    Sub Insert4()
    Dim lngLastRow As Long
    Dim lngRow As Long
    lngLastRow = Cells.Find(What:="*", _
    SearchDirection:=xlPrevious, _
    SearchOrder:=xlByRows).Row
    For lngRow = lngLastRow To 2 Step -1
    Range(lngRow & ":" & (lngRow + 3)).Insert
    Next lngRow
    End Sub

  4. #4
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Chicago
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: adding mulitple multiple rows (xp)

    WOW!
    Thanks so much to you both.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •