+ Reply to Thread
Results 1 to 5 of 5

Thread: Duplicating specific rows

  1. #1
    Registered User
    Join Date
    06-15-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Duplicating specific rows

    Okay so I have 106,461 rows in my file. And there are 5323 rows specific rows I want to duplicate. I want to duplicate row 4, 10, 24, 30, 44, 50, 64, 70.... and so on and so forth. Is there any faster way to accomplish this?

  2. #2
    Registered User
    Join Date
    06-09-2011
    Location
    PH
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Duplicating specific rows

    Two questions:
    Where do you want those rows to be duplicated into?
    Is there a specific pattern rows are selected? It seems to me the rows are random.

  3. #3
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,274

    Re: Duplicating specific rows

    Hi jpham and welcome to the forum,
    Create a helper column in the column to the right of your columns of data. Put this formula in it and pull it down for all your rows.
    In Row 1 and your helper column put this formua.
    =IF(OR(MOD(ROW(),20)-4 = 0, MOD(ROW(),20)-4 = 6),"Dup","No")
    Copy this column and paste it using VALUES ONLY one column to the right of the helper.
    Sort by this Values column so the Dup come to the top. Copy and paste the Dup rows.
    Easy Peasy!
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  4. #4
    Registered User
    Join Date
    06-15-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Duplicating specific rows

    I would like the duplicate rows to appear either right below or right above of the original column. The columns i would like duplicated are 4+(20*n) and 10+(20*n). Let me know if you can help. Thanks!

  5. #5
    Registered User
    Join Date
    06-09-2011
    Location
    PH
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Duplicating specific rows

    If I were to write code like that, I'd do it in two steps.

    1. Mark the lines you want saved.
    I don't really know how to know which columns they are according to your formula but I'd place an "X" on an empty cell on the row you want duplicated.

    2. Walk through a list as long as your database to check each line for the marker then insert cut cells there and push it down.

    EDIT: Sorry for the lack of code. Could only help with the logic. I'm sure someone will pick this up soon.
    Last edited by qcity; 06-16-2011 at 12:53 AM.

+ 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.2.0