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]
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]