I have an excel workbook that has sheet1 & sheet2.
Sheet1 has 11 columns. Columns A through K. The Name of the field in column A is “Material” which is numeric with 8 numbers.
Sheet2 has 18 columns. Columns A through R. Column B on this sheet is also called “Material” which is numeric with 8 numbers.
My goal is to create a macro, when executed will go through all the cells in column B regardless of how many (Loop) on sheet2 and vlookup sheet1 column A to see if there is an EXACT match. If it finds an Exact match, it will copy the value of that entire row on sheet1 from columns B through K and paste special in the matching “Material” row in sheet2 from columns “S” through “AC”. Columns S through K has the same name fields as columns B through K on sheet1. If a material number in sheet2 does not match any in sheet1, “NA” is populated in all the fields S through AC of that “Material” number on sheet2. How can I accomplish this task. Thanks in advance for your help.
I have attached excel file. My macro does not accomplish all I want it to do when executed.
It doesn’t populate column “AC” in sheet2
It doesn’t populate “NA” in columns S through AC to “Material” numbers on sheet2 that don’t exist in sheet1
I would like the macro to stop running when it gets to the last record on sheet2. The number of records varies. It is sometimes less than 100, sometimes in the 100’s or 1000’s.
Once again thanks for your help
Sheet1 has 11 columns. Columns A through K. The Name of the field in column A is “Material” which is numeric with 8 numbers.
Sheet2 has 18 columns. Columns A through R. Column B on this sheet is also called “Material” which is numeric with 8 numbers.
My goal is to create a macro, when executed will go through all the cells in column B regardless of how many (Loop) on sheet2 and vlookup sheet1 column A to see if there is an EXACT match. If it finds an Exact match, it will copy the value of that entire row on sheet1 from columns B through K and paste special in the matching “Material” row in sheet2 from columns “S” through “AC”. Columns S through K has the same name fields as columns B through K on sheet1. If a material number in sheet2 does not match any in sheet1, “NA” is populated in all the fields S through AC of that “Material” number on sheet2. How can I accomplish this task. Thanks in advance for your help.
I have attached excel file. My macro does not accomplish all I want it to do when executed.
It doesn’t populate column “AC” in sheet2
It doesn’t populate “NA” in columns S through AC to “Material” numbers on sheet2 that don’t exist in sheet1
I would like the macro to stop running when it gets to the last record on sheet2. The number of records varies. It is sometimes less than 100, sometimes in the 100’s or 1000’s.
Once again thanks for your help