Hi All,
Im attempting to match a variable value in a dynamic range then fill the appropriate ranges and I am having an issue. The code below works fine when the matching values are on the same row, but the matching values can appear anywhere in the specified column, not just in the same row. In addition, blank values may occur.
Any help would be greatly appreciated, thanks!
Sub testingcndfrmt()
Dim intLR As Integer
Dim intIndex As Integer
intLR = ActiveSheet.UsedRange.Rows.Count
For intIndex = 16 To intLR ' excludes header rows
If Range("C" & intIndex) <> Range("T" & intIndex) And _
Range("F" & intIndex) <> Range("AA" & intIndex) And _
Not IsEmpty(Range("C" & intIndex)) And _
Not IsEmpty(Range("T" & intIndex)) Then
Range("C" & intIndex & ":J" & intIndex).Interior.ColorIndex = 3 ' red
Range("T" & intIndex & ":AA" & intIndex).Interior.ColorIndex = 3 ' red
End If
Next intIndex
End Sub
Bookmarks