Question : Excel: Conditional formatting checking for unequal cells in portions of 2 wksts


Sheet1 and sheet2 are identical.  If any cell in sheet1 is different than sheet2, I need to apply a conditional format (change in color).  I've highlighted all of sheet2 and named it "sheet2".

I've highlighted entire sheet1 and entered under conditional formatting:
formula =A1<>INDEX(sheet_two,ROW(),COLUMN())

However, due to some complex VBA subs (with many loops) that are run, I need to limit the area of conditional formatting to several columns.  I've tried renaming sheet_2 to include only the needed columns, & also tried highlighting only the needed columms im Sheet 1, and then redefined the conditional formatting.  Neither option is working.

Thanks for advice!

Answer : Excel: Conditional formatting checking for unequal cells in portions of 2 wksts

It depends where your range starts. The suggested formula works when the range is the whole sheet or when the range starts at A1.

If the top left of the range is not A1 then you need to change the formula based on the top left cell of sheet_two, e.g. if sheet_two is defined as sheet2!D10:J20 then select that same range on sheet1 and use the formula

=D10<>INDEX(sheet_two,ROW()-ROW($D$10)+1,COLUMN()-COLUMN($D$10)+1)

regards, barry

 

Random Solutions  
 
programming4us programming4us