+ Reply to Thread
Results 1 to 4 of 4

Insert rows between rows without replacing existing data.

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    17

    Question Insert rows between rows without replacing existing data.

    I am having a problem with the following macro.

    Here is the scenario and what i am trying to do:

    I have an excel sheet with about 7000 rows in it.

    I need to copy 23 rows of data at the top of the sheet that contain formulas.

    I need to paste / insert these 23 rows of data between every existing row in the sheet.

    So for example

    Line 1
    < insert 23 copied rows here
    Line 2
    < insert 23 copied rows here
    Line 3
    < insert 23 copied rows here
    Line 4
    < insert 23 copied rows here
    etc, etc...

    My problem:
    The proper rows are copied and they seem to be pasted every second row (i think) but the pasted rows are over writting the rows below them.it. Another words this isn't really inserting the rows as much as it is pasting the rows every second row and overwriting any data.

    I need to fix this so that it does not overwrite anything. I want the 23 rows to be inserted between existing rows and keep all existing rows.

    The code that I am using is below. I have a header row and the 23 rows I want to copy start on row A3. The first insert should be between row 26 and row 27.

    Please help me fix this! Thank you in advance!


    Please Login or Register  to view this content.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Insert rows between rows without replacing existing data.

    Something like this,

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    08-03-2012
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Insert rows between rows without replacing existing data.

    One problem with this is that it only inserts the first column of date between rows. I need this to copy and insert the entire row.

    It seems to insert rows properly but it only inserts the first column of data. How can we change this so that it copies entire rows and inserts the entire row between each existing row?

    I cant figure out how you change the range to be the entire row of data.


    Also, how do you control which cell the copied data starts from?


    I have attached a cpoy of what i am working on. This is only a sample of the data.

    SailData_MainSails_08_15_2012-testing.xlsm

    Thanks
    Last edited by m-steele@shaw.ca; 08-15-2012 at 11:51 AM.

  4. #4
    Registered User
    Join Date
    08-03-2012
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Insert rows between rows without replacing existing data.

    Can anyone help me. Out furthar with this?

    Thanks

+ 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