How to change cell formatting based on another cell's format?
I tried the following code:
Range("A9:A9").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=LEN(A9)>40"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
If Selection.FormatConditions(1).Interior.Color = 255 Then
ActiveSheet.Range("A8").Interior.Color = 255
End If
Selection.FormatConditions(1).StopIfTrue = False