+ Reply to Thread
Results 1 to 3 of 3

Loop until cell values match then copy, move to next cell and loop and copy again

  1. #1
    Registered User
    Join Date
    06-23-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    49

    Loop until cell values match then copy, move to next cell and loop and copy again

    Trying to copy a row of data from table 2 and paste it in the correct row of table 1. Then go to the second row of the table 2 and paste into the correct row of table 1, repeating the process until everything in table 2 is copied to the correct position in table 1.

    Code below works fine putting the first row of table 2 where it belongs in table 1.

    I just cannot figure out how to put this first loop inside a second loop that starts at the first 'Name' in table 2, does the loop in the code below, selects the second 'Name' in table 2, does the loop below, and so on until the end of all the 'Names'.

    There is probably a better way to do this (VLOOKUP) but since I have started wouldn't mind knowing how to do it anyway.

    Thanks

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Loop until cell values match then copy, move to next cell and loop and copy again

    Hello potga,

    Here's an example of a loop within a loop:

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Loop until cell values match then copy, move to next cell and loop and copy again

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy Cell From One Cell and Paste to next blank cell, Loop until last row/column
    By Beginner Level in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-01-2020, 02:38 AM
  2. [SOLVED] Loop through column check for colored cell and copy that cell to cells below it.
    By RENCE19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2013, 04:51 AM
  3. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  4. [SOLVED] Loop-copy cell values from a row, and then copy them into a column
    By vukovicnikola in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2012, 06:03 AM
  5. Loop to copy and paste cell values
    By prontrad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2011, 09:52 AM
  6. Need macro to loop through input cell values and copy output value
    By jaf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2011, 02:59 PM
  7. Copy cell values until change of value with loop
    By sdadswell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2011, 08:40 PM

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