+ Reply to Thread
Results 1 to 7 of 7

Combine two tables

  1. #1
    Registered User
    Join Date
    12-03-2011
    Location
    The end of the rainbow
    MS-Off Ver
    Excel 2003
    Posts
    12

    Combine two tables

    Hi,
    I know the vlookup formula will come in handy.

    Could someone please write me a code that matches the values of the cells in 2 columns in 2 separate tables then generates a third table? If a value appears in the first table but not in the second I would like in in the third table with a blank for the missing value. If table 2 has a value that table 1 does not I would not like to see it in the third table. An example of what I am looking for is in the excel sheet attached.

    Please help.

    Thank you.


    Regards,
    Ashley
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: VBA n00b needs VBA code to combine two tables based on values in a cell

    Hi, Ashley. Try it
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-03-2011
    Location
    The end of the rainbow
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: VBA n00b needs VBA code to combine two tables based on values in a cell

    Dear Nilem,
    Thank you!! I will work on this.

    Regards,
    Ashley

  4. #4
    Registered User
    Join Date
    12-03-2011
    Location
    The end of the rainbow
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: VBA n00b needs VBA code to combine two tables based on values in a cell

    ..........
    Last edited by Ashleyyy; 02-10-2012 at 10:07 AM.

  5. #5
    Registered User
    Join Date
    12-03-2011
    Location
    The end of the rainbow
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: VBA n00b needs VBA code to combine two tables based on values in a cell

    Hi Nilam,
    I'm so so sorry but my example is wrong. Table 1 may have repeats of a value. I'd like for repeats of a value in table 1 to generate the same output in table 3. I tried with the current code this does not happen. I've attached an updated example for this.

    I'd appreciate it if you could modify the code to reflect this, I'm sorry I overlooked this earlier.

    Thank you.


    Regards,
    Ashley
    Attached Files Attached Files

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: VBA n00b needs VBA code to combine two tables based on values in a cell

    Let's swap the "x" and "y"
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-03-2011
    Location
    The end of the rainbow
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Combine two tables

    Thanks Nilam!!

+ 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