Colour a Cell if Criteria matched on a row.

VBABeginner1

New Member
Joined
Dec 6, 2014
Messages
31
Hello,

I have 222 columns of data in one table that I need to compare to another.

What I want it to do is: Highlight in Green if it matches and Red if it doesn't.

Basically a report is "Exported" from software and pasted into the excel file into the tab "ChExport"

Then I want to run a macro on "ChExport" that matches the Serial Number to the same serial number on the tab "Compare". If it finds a serial number that matches, it will then go through and compare all 222 columns of data and highlight them red if false and green if true.

There can be as little as one row of data in "ChExport" or up to 20,000 rows.

Below is what the table looks like. Both Tables on "ChExport" and "Compare" are laid out identically. Serial number begins on "G2"
[TABLE="width: 500"]
<tbody>[TR]
[TD]
[TABLE="width: 469"]
<tbody>[TR]
[TD]Serial Number
[/TD]
[TD]Asset Location
[/TD]
[TD]Area
[/TD]
[TD]Zone
[/TD]
[TD]NZ
[/TD]
[TD]Position
[/TD]
[TD]Price
[/TD]
[/TR]
[TR]
[TD]2251158
[/TD]
[TD]A
[/TD]
[TD]1
[/TD]
[TD]1
[/TD]
[TD]2
[/TD]
[TD]1
[/TD]
[TD]N/A
[/TD]
[/TR]
[TR]
[TD]1995712
[/TD]
[TD]A
[/TD]
[TD]1
[/TD]
[TD]1
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]0.01
[/TD]
[/TR]
[TR]
[TD]1995715
[/TD]
[TD]B
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]2
[/TD]
[TD]4
[/TD]
[TD]0.06
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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