+ Reply to Thread
Results 1 to 3 of 3

Loop to copy rows from two worksheets until reaching empty row

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    4

    Question Loop to copy rows from two worksheets until reaching empty row

    Hi,

    I've been searching around for a way to do this, which I would think should be pretty easy to do, but I haven't found something that works yet.
    I have worksheets X, Y and Z. X and Y contain the same amount of rows with corresponding data, and Z only has data in the first three rows. I want a macro that can copy the data from the corresponding rows in X and Y and paste them pairwise in Z, as shown below:

    Z Row 1 data
    Z Row 2 data
    Z Row 3 data
    (empty row)
    X Row 2
    Y Row 2
    (empty row)
    X Row 3
    Y Row 3
    (empty row)
    X Row 4
    Y Row 4


    ... and so on. The loop should end at the first empty row in X or Y (it will be the same for both).
    I really appreciate if someone could help me with this, and hope I've made it clear what I'm looking for.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Loop to copy rows from two worksheets until reaching empty row

    Untested but should be close. If not post a example workbook

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    09-11-2012
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Loop to copy rows from two worksheets until reaching empty row

    Thanks Mike! As you said, that was pretty close. I had to make a few tweaks to make it work with my data.

    Please Login or Register  to view this content.

+ 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