Hi,
Can someone help me check the below code? The first sub works, it changes the interior color of duplicate cells in selection.
However, the second one not work because of the if function.
The offset and interior condition both not work.
Thank you!
---------------------------------------------------------------------------------------------------
Sub dup()
' dup Macro
Selection.FormatConditions.AddUniqueValues
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).DupeUnique = xlDuplicate
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Call Bold
End Sub
'wrong one but right intention
Sub Bold()
For Each cell In Selection
If cell.Interior.ColorIndex = 255 Then
cell.Offset(-4, 0).Font.Bold = True
End If
Next cell
End Sub