Macro to files two fields that match and then find the differences in other fields and move them to new table

starheartbeam

New Member
Joined
Aug 8, 2018
Messages
18
I need to write a macro. I have two tabs each tab has the same type of rows they are just from different dates.

I need to look a Sheet A at column C and compare it to Sheet B column C and find the ones that match.
If both column C match I need to look a column B for that row and see if they do not match. If they do not match I need to copy that row from Sheet B and paste it into Sheet C. I have been trying to figure this out for a while and can't seem to get it to work. I need to put this in a macro because i have a macro doing some other things to this file and I need to add this piece to it. Please any help would be great.

Example
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sheet A
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Sheet B
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/2/19
[/TD]
[TD]USA
[/TD]
[TD]1234
[/TD]
[TD][/TD]
[TD]1/4/19
[/TD]
[TD]USA
[/TD]
[TD]1234
[/TD]
[/TR]
[TR]
[TD]1/2/19
[/TD]
[TD]USA
[/TD]
[TD]9876
[/TD]
[TD][/TD]
[TD]1/4/19
[/TD]
[TD]CA
[/TD]
[TD]9876
[/TD]
[/TR]
[TR]
[TD]1/2/19
[/TD]
[TD]USA
[/TD]
[TD]4562
[/TD]
[TD][/TD]
[TD]1/4/19
[/TD]
[TD]CA
[/TD]
[TD]4562
[/TD]
[/TR]
</tbody>[/TABLE]


So for the above example Sheet C after the macro would look like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sheet C
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/4/19
[/TD]
[TD]CA
[/TD]
[TD]9876
[/TD]
[/TR]
[TR]
[TD]1/4/19
[/TD]
[TD]CA
[/TD]
[TD]4562
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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