+ Reply to Thread
Results 1 to 5 of 5

How to copy/paste one row into multiple rows and automate it?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Stellenbosch, South Africa
    MS-Off Ver
    Excel 2003; Excel 2007; Excel 2010; Excel 2013
    Posts
    136

    Re: How to copy/paste one row into multiple rows and automate it?

    Welcome to the forum.

    Something like this should work. You need to add this code to a standard module in your workbook.
    ALT+F11 to open the VBE
    Insert > Module
    Paste into the code pane on the right.
    Close the VBE.

    To run hit ALT+F8 and choose to run 'MyCopy' from the dialog.

    Option Explicit
    Sub MyCopy()
    Dim lngLastRow As Long
    Dim lngRow As Long
    lngLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    For lngRow = 3 To lngLastRow
        Range(Cells(lngRow, "A"), Cells(lngRow, "G")).Copy _
            Cells(Rows.Count, "J").End(xlUp).Offset(1).Resize(10, 7)
    Next lngRow
    End Sub
    Regards

    Jon (Excel 2003, 2007, 2010, 2013)

  2. #2
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Stellenbosch, South Africa
    MS-Off Ver
    Excel 2003; Excel 2007; Excel 2010; Excel 2013
    Posts
    136

    Re: How to copy/paste one row into multiple rows and automate it?

    A formula solution for your sample provided:

    =INDEX($A$3:$G$913,(ROW()-3)/10+1,MATCH(S$2,$A$2:$G$2,0))

    In J3 and copied down to end of range in column P. In this case it's P9112.

  3. #3
    Registered User
    Join Date
    06-01-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to copy/paste one row into multiple rows and automate it?

    Quote Originally Posted by JONvdHeyden View Post
    A formula solution for your sample provided:

    =INDEX($A$3:$G$913,(ROW()-3)/10+1,MATCH(S$2,$A$2:$G$2,0))

    In J3 and copied down to end of range in column P. In this case it's P9112.
    Hi thanks so much!

    This formula didnt work for some reason

+ 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