excel vba macro to match cells from two different workbooks and copy and paste accordingly
i have 2 workbooks, workbook A and workbook B. Each workbook has a table. workbook A has 2 columns. All three columns are filled. product_id Machine_number and Workbook B has the same 2 columns but only one column, Product_id, is filled. The other 1 column is vacant. I need to match the cells of product_id of both workbooks. If the product_id found in workbook A matches workbook B, then the machine number of that product id should be copied from workbook A to workbook B. I have performed this using this code: Sub UpdateW2() Dim w1 As Worksheet, w2 As Worksheet Dim c As Range, FR As Long