Appending excel range on the top of another range with a condition? RRS feed

  • Question

  • I have a data set in excel with looks like this(below):

    1. i have two tables table number 1 and 2
    2. My objective is to create a result table as shown from table 1 and table 2


    1.  i need to write a loop that goes through table 1 (col_1)  and table 2 (col_1), and checks if the values are equal. if so, it adds the col_1, col_2, col_3 from table and only col_3 from table 2 into the result table. the code i wrote works for these section
    2. if they are not equal, it should append the rows from table one, and table 2 into the result table with our duplication. example can be seen in the above table. this is the challenging part that the code i wrote failed badly
    3. any help or suggestion or approach is highly appreciated! 

    Saturday, May 9, 2020 3:21 PM