+ Reply to Thread
Results 1 to 2 of 2

Excel Macro to insert rows in a list

  1. #1
    MartyCole
    Guest

    Excel Macro to insert rows in a list


    I'm sure this has been asked in the past but I couldn't find it in the
    list of replies.

    I need a macro to skip down a number (usually 5. sometimes 3 in
    different spreadsheets) then insert a blank row. it needs to continue
    until it reaches the end of the list (anywhere from 100 to 3000
    lines).

    I could do this in Lotus years ago but I'm lost in Excel...

    Thanks for any help you can provide


    --
    MartyCole
    ------------------------------------------------------------------------
    MartyCole's Profile: http://www.msusenet.com/member.php?userid=1217
    View this thread: http://www.msusenet.com/t-1870429758


  2. #2
    Bob Phillips
    Guest

    Re: Excel Macro to insert rows in a list

    Dim iLastRow As Long
    Dim i As Long
    Const nRows As Long = 5

    iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    For i = (iLastRow \ nRows) * nRows + 1 To 1 Step -nRows
    Rows(i).Insert
    Next i


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "MartyCole" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I'm sure this has been asked in the past but I couldn't find it in the
    > list of replies.
    >
    > I need a macro to skip down a number (usually 5. sometimes 3 in
    > different spreadsheets) then insert a blank row. it needs to continue
    > until it reaches the end of the list (anywhere from 100 to 3000
    > lines).
    >
    > I could do this in Lotus years ago but I'm lost in Excel...
    >
    > Thanks for any help you can provide
    >
    >
    > --
    > MartyCole
    > ------------------------------------------------------------------------
    > MartyCole's Profile: http://www.msusenet.com/member.php?userid=1217
    > View this thread: http://www.msusenet.com/t-1870429758
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1