Not working. I am obviously doing something wrong. I just want the G cell to highlight if it's the same as what is in the I cell. And then to go back to no highlight once the conditions are met.
Sub ConditionalFormatFirstNames()
Dim lr As Long
lr = ActiveSheet.Cells(Rows.count, 1).End(xlUp).Row
Dim LastNames As Range
Set LastNames = Range("I:I")
With ActiveSheet.Range("G2:G" & lr)
.FormatConditions.Delete
.FormatConditions.Add xlExpression, Formula1:="=$G2 = ""LastNames.Value"""
.FormatConditions(1).Interior.Color = RGB(156, 0, 6)
End With
End Sub
Sub ConditionalFormatFirstNames()
Dim lr As Long
lr = ActiveSheet.Cells(Rows.count, 1).End(xlUp).Row
Dim LastNames As Range
Set LastNames = Range("I:I")
With ActiveSheet.Range("G2:G" & lr)
.FormatConditions.Delete
.FormatConditions.Add xlExpression, Formula1:="=$G2 = ""LastNames.Value"""
.FormatConditions(1).Interior.Color = RGB(156, 0, 6)
End With
End Sub