+ Reply to Thread
Results 1 to 4 of 4

inserting multiple rows in one shot?

Hybrid View

  1. #1
    Greg
    Guest

    inserting multiple rows in one shot?

    Is it possible to insert a row in every other line all at ounce in an excel
    document?
    In otherwords I have an Excel document that I have to insert a new row at
    every other line and would like a way to do it all in one shot instead of
    manually right-clicking each line and inserting a row.

    If possible how can this be done

    Thanks in advance.
    Greg

  2. #2
    Don Guillett
    Guest

    Re: inserting multiple rows in one shot?

    something like

    for i=cells(rows.count,"a").end(xlup).row to 2 step -2
    rows(i).insert
    next i

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "Greg" <gregkh@hotmail.com> wrote in message
    news:ABBF0BFD-029B-49DE-A31A-FFA90506B185@microsoft.com...
    > Is it possible to insert a row in every other line all at ounce in an
    > excel
    > document?
    > In otherwords I have an Excel document that I have to insert a new row at
    > every other line and would like a way to do it all in one shot instead of
    > manually right-clicking each line and inserting a row.
    >
    > If possible how can this be done
    >
    > Thanks in advance.
    > Greg




  3. #3
    Chip Pearson
    Guest

    Re: inserting multiple rows in one shot?

    You can do it with a VBA macro. Select the cells in which you
    want to insert the blank lines and run the following code:

    Sub AAA()
    Dim Ndx As Long
    For Ndx = Selection.Cells(1, 1).Row + 1 To _
    Selection.Cells(1, 1).Row + (Selection.Rows.Count *
    2) Step 2
    Rows(Ndx).Insert
    Next Ndx
    End Sub


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "Greg" <gregkh@hotmail.com> wrote in message
    news:ABBF0BFD-029B-49DE-A31A-FFA90506B185@microsoft.com...
    > Is it possible to insert a row in every other line all at ounce
    > in an excel
    > document?
    > In otherwords I have an Excel document that I have to insert a
    > new row at
    > every other line and would like a way to do it all in one shot
    > instead of
    > manually right-clicking each line and inserting a row.
    >
    > If possible how can this be done
    >
    > Thanks in advance.
    > Greg




  4. #4
    Gord Dibben
    Guest

    Re: inserting multiple rows in one shot?

    If the inserted rows are just for readability/appearance, you can select a whack
    of rows and double their height at one go.

    Otherwise, go with Chip's code.


    Gord Dibben MS Excel MVP

    On Wed, 28 Jun 2006 07:04:02 -0700, Greg <gregkh@hotmail.com> wrote:

    >Is it possible to insert a row in every other line all at ounce in an excel
    >document?
    >In otherwords I have an Excel document that I have to insert a new row at
    >every other line and would like a way to do it all in one shot instead of
    >manually right-clicking each line and inserting a row.
    >
    >If possible how can this be done
    >
    >Thanks in advance.
    >Greg



+ 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