+ Reply to Thread
Results 1 to 6 of 6

The fastest way to loop in 2 tables

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    The fastest way to loop in 2 tables

    Hi,

    i have source table like here:

    Screenshot_6.png

    The goal is to loop through all rows and for specific column names provided in column B populate values in tables in specific sheets.
    So for Tab1 Scenario we will get the result like here:

    Screenshot_7.png

    How to do this in the best possible way ?

    Best wishes,
    Jacek
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: The fastest way to loop in 2 tables

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: The fastest way to loop in 2 tables

    thank you Mumps.

    Hmm interesting approach.
    Copying and paste would be good if we will have column names in order. But i can have situation where i have only column3 in Tab2 Scenario to fullfill.

    Screenshot_11.png

    So copying will be not good.

    Best,
    Jacek
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi !

    In this case you may use an advanced filter - Excel basics ! - which can copy only by headers whatever their destination order
    and that needs a single codeline …
    Last edited by Marc L; 06-20-2019 at 01:07 PM. Reason: typo …

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: The fastest way to loop in 2 tables

    hi,

    thank you Marc L.

    Best,
    Jacek

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: The fastest way to loop in 2 tables

    Has your problem been solved? If not, you can simply insert some code at the beginning of the macro to sort the "Source" sheet by column B in ascending order.

+ 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. Is it possible to Loop through Tables and Copy TableHeader ?
    By nordicdust in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-28-2018, 07:00 PM
  2. How to loop through massive data with fastest code
    By caooi23 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2015, 02:24 AM
  3. Replies: 1
    Last Post: 12-18-2014, 09:43 PM
  4. Loop through tables
    By worldsphere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2011, 05:42 PM
  5. Using Hlookup on multiple tables with for..next loop
    By Cerberus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-30-2010, 04:52 PM
  6. Code loop through two tables checking and altering
    By excel_lover in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-14-2008, 05:50 PM
  7. Fastest Loop Code?
    By Chard in forum Excel General
    Replies: 2
    Last Post: 05-29-2007, 11:17 AM

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