I am labeling duplicate cells a certain color like this
However, once this is done, excel is not recognizing the color.
if i run this sub on one of the cells, it does not recognize the color
but when i color the cell with this code, it will recognize the color with the previous code.
Does anyone know what I am doing wrong?
Code:
Sheets("Duplicatesw").Select
Columns("E:E").Select
Selection.FormatConditions.AddUniqueValues
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).DupeUnique = xlDuplicate
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ColorIndex = 8
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Cells.Select
if i run this sub on one of the cells, it does not recognize the color
Code:
Sub recognize()
If ActiveCell.Interior.ColorIndex = 8 Then
MsgBox "its blue"
Else
MsgBox "its not"
End If
End Sub
Code:
Sub makecolor()
ActiveCell.Interior.ColorIndex = 8
ActiveCell.Offset(1, 0).Select
End Sub