By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

Become an Σxpert at Σxcel.com

 


Highlight_PrevCurDiffs - udf

This code is passed two cells and will highlight the cells in orange if they're different.

To call

dim c1 as Range, c2 as Range
set c1 = range("A1")
set c2 = range("B1")
Hilight_PrevCurDiffs c1, c2

Sub Hilight_PrevCurDiffs(c1 as range, c2 as range)

if c1.value <> c2.value then
    Range(c1.address & "," & c2.address).select
    With Selection.Interior
      .Color = 49407 ' orange
    end with
End If

End Sub