Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Melbourne, Australia
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inserting blank lines (Excel 2000)

    Hi Everyone,

    If I have a spreadsheet with rows of data, any ideas on the code to insert blank lines between each row of data?

    Thanks Kindly,

    Kerrie

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

    Re: Inserting blank lines (Excel 2000)

    The following subroutine inserts blank rows in the "current region", that is the rectangular area bordered by blank rows and columns that contains the active cell.

    Sub InsertRows()
    Dim rng As Range
    Dim lngRowCount As Long
    Dim i As Long
    Set rng = ActiveCell.CurrentRegion
    lngRowCount = rng.Rows.Count
    For i = lngRowCount To 2 Step -1
    rng(i, 1).EntireRow.Insert
    Next
    End Sub

    If you want to insert blank rows within the currently selected area only, replace ActiveCell.CurrentRegion by Selection.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Melbourne, Australia
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting blank lines (Excel 2000)

    Thank you, perfect!!

    Kerrie [img]/forums/images/smilies/smile.gif[/img]

Posting Permissions

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