Need to compare data in multiple workbooks

jbass350z

New Member
Joined
Oct 19, 2009
Messages
22
I have 2 spreadsheets that I need to compare. I need to run a macro that compares data sets in both spreadsheet and then outputs the differences in a new book.

It needs to check that that line PART NUMBER exists in both files, and that the QUANTITY matches. If there are differences, it should log those to the new sheet, along with a note of which spreadsheet is missing the data, or has different quantities.

How can I do this?

Spreadsheet 1

[table="width: 500, class: grid, align: center"]
[tr]
[td]A[/td]
[td]B[/td]
[td]C[/td]
[td]D[/td]
[/tr]
[tr]
[td]PART NUMBER[/td]
[td]QUANTITY[/td]
[td]DESCRIPTION[/td]
[td]COMMENT[/td]
[/tr]
[tr]
[td]PART 1[/td]
[td]2[/td]
[td]FIRST PART SAMPLE[/td]
[td]THIS IS A COMMENT[/td]
[/tr]
[tr]
[td]PART 2[/td]
[td]5[/td]
[td]SECOND PART[/td]
[td]ANOTHER COMMENT[/td]
[/tr]

[/table]

Spreadsheet 2

[table="width: 500, class: grid, align: center"]
[tr]
[td]A[/td]
[td]B[/td]
[td]C[/td]
[td]D[/td]
[/tr]
[tr]
[td]PART NUMBER[/td]
[td]QUANTITY[/td]
[td]DESCRIPTION[/td]
[td]COMMENT[/td]
[/tr]
[tr]
[td]PART 1[/td]
[td]2[/td]
[td]FIRST PART SAMPLE[/td]
[td]THIS IS A COMMENT[/td]
[/tr]
[tr]
[td]PART 2[/td]
[td]15[/td]
[td]SECOND PART[/td]
[td]ANOTHER COMMENT[/td]
[/tr]
[tr]
[td]PART 3[/td]
[td]10[/td]
[td]3RD PART[/td]
[td]ANOTHER COMMENT[/td]
[/tr]
[/table]


Output would be ONLY items that are different between the two spreadsheets. Something like this :


[table="width: 500, class: grid, align: center"]
[tr]
[td]A[/td]
[td]B[/td]
[td]C[/td]
[td]D[/td]
[td]E[/td]
[td]F[/td]

[/tr]
[tr]

[td]PART NUMBER[/td]
[td]QUANTITY SHEET 1[/td]
[td]QUANTITY SHEET 2[/td]
[td]DESCRIPTION[/td]
[td]COMMENT[/td]
[td]PROBLEM[/td]
[/tr]
[tr]
[td]PART 2[/td]
[td]5[/td]
[td]15[/td]
[td]SECOND PART[/td]
[td]ANOTHER COMMENT[/td]
[td]DIFFERENT QUANTITY[/td]
[/tr]
[tr]
[td]PART 3[/td]
[td]0[/td]
[td]10[/td]
[td]3RD PART[/td]
[td]ANOTHER COMMENT[/td]
[td]MISSING FROM SHEET 1[/td]
[/tr]

[/tr]
[/table]
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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