Hi!
I desperately need your help! I am very new to VBA, but need this code urgently...
I have a workbook with 2 sheets, one is a list of deliveries with 10 columns and endless number of rows (Sheet1) , which is filled by the company, and another with 23 columns and even more rows than in the first one (Sheet2), and this is filled by supplier.
The general idea is to check if company's list has all the products listed and copy missing information from the supplier's list to the company's list.
What I need from the macro is:
1) Compare products from column B (starting from B3 to last row) from Sheet2 to column D (also from D3 to last row) from Sheet 1.
2) If products from Sheet2 do appear on Sheet1, then copy cells from Sheet2:
1. Cell from column C from Sheet2 to column C in Sheet1 (let's say it is the first product, so Sheet2.C4 to Sheet1.C4) (these are the columns with heading Number - if this can help...)
2. Sheet2.I4 to Sheet1.M4 (Columns called Weight1)
3. Sheet2.L4 to Sheet1.O4 (Columns called Delivery date)
3) Calculate the difference between columns (column L- column M) in the column N.
4) Not very important, but would be great if Excel alerted if he changes any cell that already had data inserted. So in case Excel copies info from Sheet2 to the blank cell or it contains exactly same info - then it is ok, but if value was different - then highlight cell in red.
5) Lastly, for those products, which did not appear on Sheet1, copy info to the last to the next empty row on Sheet1: Sheet2.B to Sheet1.D, Sheet2.C to Sheet1.C, Sheet2.I to Sheet1.M, Sheet2.L to Sheet1.O (basically all the same as before, just fill it up from supplier's list to company's list)
I hope that's understandable and not very complicated...
I would very much appreciate your help!
Thank you in advance!
I desperately need your help! I am very new to VBA, but need this code urgently...
I have a workbook with 2 sheets, one is a list of deliveries with 10 columns and endless number of rows (Sheet1) , which is filled by the company, and another with 23 columns and even more rows than in the first one (Sheet2), and this is filled by supplier.
The general idea is to check if company's list has all the products listed and copy missing information from the supplier's list to the company's list.
What I need from the macro is:
1) Compare products from column B (starting from B3 to last row) from Sheet2 to column D (also from D3 to last row) from Sheet 1.
2) If products from Sheet2 do appear on Sheet1, then copy cells from Sheet2:
1. Cell from column C from Sheet2 to column C in Sheet1 (let's say it is the first product, so Sheet2.C4 to Sheet1.C4) (these are the columns with heading Number - if this can help...)
2. Sheet2.I4 to Sheet1.M4 (Columns called Weight1)
3. Sheet2.L4 to Sheet1.O4 (Columns called Delivery date)
3) Calculate the difference between columns (column L- column M) in the column N.
4) Not very important, but would be great if Excel alerted if he changes any cell that already had data inserted. So in case Excel copies info from Sheet2 to the blank cell or it contains exactly same info - then it is ok, but if value was different - then highlight cell in red.
5) Lastly, for those products, which did not appear on Sheet1, copy info to the last to the next empty row on Sheet1: Sheet2.B to Sheet1.D, Sheet2.C to Sheet1.C, Sheet2.I to Sheet1.M, Sheet2.L to Sheet1.O (basically all the same as before, just fill it up from supplier's list to company's list)
I hope that's understandable and not very complicated...
I would very much appreciate your help!
Thank you in advance!