+ Reply to Thread
Results 1 to 4 of 4

Loop thru row and copy matching record to appropriate columns

  1. #1
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Thumbs up Loop thru row and copy matching record to appropriate columns

    I posted a similar question yesterday, which had an elegant solution thanks to Fluff13.

    My question yesterday was......

    Basically I take the unique records in column B and place in a column on row 1 transposed, shown in image as column F thru I.

    I then need to loop thru column B and when the value in F1 is found copy the value in column C to next available row in column F, once cycled thru all rows in column B then repeat the same for value in G1 thru I1. Attached image shows how data should look

    Capture-1.PNG

    The following code courtesy of Fluff13 worked great.

    Please Login or Register  to view this content.
    Now I find a need to add the corresponding value in the column A, as shown in attached image.

    Capture.PNG

    Thanks
    Last edited by jprlimey; 04-03-2018 at 02:02 PM. Reason: SOLVED

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,708

    Re: Loop thru row and copy matching record to appropriate columns

    How about
    Please Login or Register  to view this content.
    Whilst this is slower than previous, It's still under 4 seconds on the same test data

  3. #3
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Loop thru row and copy matching record to appropriate columns

    Fluff13,

    This worked a treat, thanks so much for the assistance.

    Thanks

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,708

    Re: Loop thru row and copy matching record to appropriate columns

    Glad to help & thanks for the feedback

+ 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. Prevent duplicate entry in a userform by matching record to multiple columns.
    By rsbuslon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-05-2023, 07:44 PM
  2. [SOLVED] Loop thru row and copy matching record to appropriate column
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-02-2018, 11:29 AM
  3. [SOLVED] Find Last Record matching Criteria in multiple columns
    By Foreverlearning in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-17-2017, 03:39 AM
  4. Loop across Columns view outcome and record a result
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2014, 09:57 AM
  5. [SOLVED] How to return the lowest value of a series of columns when matching a record
    By Ozzy24 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-10-2013, 01:36 AM
  6. Use while loop to go through the rows finding matching two first columns in each row
    By sergeynew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-07-2012, 10:43 PM
  7. Copy data to other sheet + Loop to last record
    By jantonio in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2010, 04:00 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