+ Reply to Thread
Results 1 to 7 of 7

How to create duplicae rows

  1. #1
    Registered User
    Join Date
    07-12-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    How to create duplicae rows

    I am trying to create a macro that will copy and duplicate five multiple rows below that one or in another sheet


    Example:

    Original Data

    A001
    A002
    A003



    Data Needed

    A001
    A001
    A001
    A001
    A001
    A002
    A002
    A002
    A002
    A002
    A003
    A003
    A003
    A003
    A003

    Any help anyone may be able to give would be very helpful. Thanks in advance

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to create duplicae rows

    Jeff73,

    Welcome to the forum. You can use the following code. Just select what you want to make duplicates of, and the code will duplicate each item 4 times (so you'll end up with 5 total per item, including the original):
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to create duplicae rows

    formula approach
    assuming data starts in sheet1 a1
    =INDEX(Sheet1!A:A,CEILING(ROW(A1)/5,1)) dragged down
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    07-12-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: How to create duplicae rows

    Thanks for the quick response and the help!! I just noticed it was my first post and I messed up the spelling in the title... lol

    The macro seems to work fine but I guess I should have mentioned it but I have data in row B, C,D, and so on that I need to duplicate and carry along with that data. I hope that makes sense.

    Thanks in advance for the help

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to create duplicae rows

    formula will do that drag it across then down

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to create duplicae rows

    Jeff73,

    The macro seems to work fine but I guess I should have mentioned it but I have data in row B, C,D, and so on that I need to duplicate and carry along with that data
    The macro already does that:
    Quote Originally Posted by tigeravatar View Post
    Just select what you want to make duplicates of

    So you just need to select the range you want, then run the macro. Martin's solution also works if you already have free rows.

    ~tigeravatar

  7. #7
    Registered User
    Join Date
    07-12-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: How to create duplicae rows

    tigeravatar

    martindwilson,

    Thanks for all your help! I ended up using the macro and it works great

+ 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