We help IT Professionals succeed at work.

Highlight the difference (VBA/Formula)

zhshqzyc
zhshqzyc asked
on
Please see the attached file. If the cells in cloumn A and B are different, please color it.
I have thousands rows.
Book1.xls
Comment
Watch Question

Mechanical Engineer
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013
Commented:
I suggest using Conditional Formatting:

Select columns A and B
Open the Conditional Formatting menu item
Choose a New Rule
Choose Using a formula
=$A1<>$B1
Click the Format button and choose a Fill color

Author

Commented:
One follow up: can you exclude the first row which is the header?
byundtMechanical Engineer
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
You can select as many cells as you would like, up to full columns. If you want to select just cells A2:B5873, that would be OK. You would then apply conditional formatting to the selected cells using the formula:
=$A2<>$B2

If you have already applied conditional formatting to the entire column, you may find it easier to remove the conditional formatting from cells A1 and B1. To do this, select A1 and B1, open the Conditional Formatting menu item, choose Clear Rules and then choose Clear rules from selected cells.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.