Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compare two columns in VBA`

Status
Not open for further replies.

kimchavis

Technical User
Jan 7, 2004
66
US
Hi,

Im new to VBA and im trying to compare by columns in excel and shade those that are different. I have column B and C that are supposed to be the same but if they are different i want to highlight them. The same goes for D and E, F and G etc.. This goes on for 200 columns so you can see why this needs to be done in VBA. Can someone point me to the thread that solves for this, so i can get some idea of what type of code i would use to do this?

Any help would be appreciated. Thanks!
 




Its very simple with Format/Conditional Formatting. You need two sets of conditions

select column A. CF Formula is:
[tt]
=AND(ISNA(MATCH(A1,B:B,0)),A1<>"")
[/tt]
select column b. CF Formula is:
[tt]
=AND(ISNA(MATCH(A1,A:A,0)),B1<>"")
[/tt]
Select both column, Format painter and swipe the desired column.

VOLA!

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top