Work around Conditional Formatting

A

Andy Chan

Dear all,

There are 2 worksheets (Sheet1, Sheet2) containing similar data in my
workbook. I want to underline the text in a cell in Sheet2 if the text in
that cell is the same as the cell in the same place in Sheet1. (For example,
if Sheet1!A1 = Sheet2!A1, then Sheet2!A1 is underlined.) Can I write a
user-defined function to check whether the contents in two cells are equal?
Thanks in advance.

Best Regards,
Andy
 
D

David McRitchie

Hi Andy,
Please include the complete question in the text body, one should
not be expected to look at the subject to understand the question
once the question is actually being viewed.

Conditional Formatting unfortunately cannot refer to another sheet,
but you can use a defined name for a reference and use that.
Select Cell A1 on Sheet2 then place sht2 into the name box.
as a shortcut to using Insert, Name, Define, ...

Then select the area of interest on Sheet1 with cell A1 as the active cell.
Format, Conditional Formatting,
Condition 1 Formula is: =A1=OFFSET(sht2,ROW()-1,COLUMN()-1)

You might want to use a pattern color instead of using Font, underscore
to try to underscore a empty cell.
 
Top