Comparing data from different sheets and filling up missing information

artsanna

New Member
Joined
Nov 18, 2014
Messages
1
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!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top