(Solved) – Excel VBA MACRO Format Conditions based on value length

  • by
(solved)-–-excel-vba-macro-format-conditions-based-on-value-length

How can I use VBA to Format a cell if it contains some value with a length greater than 1?

(This rule should ofc apply to all cells in the range)

Set text_value = Range("$A:$A").FormatConditions.Add(Type:=xlCellValue, Operator:=xlEqual, Formula1:="=--LEN($A1)>1")

   With text_value
    .Interior.Color = vbRed
    .Borders.LineStyle = xlContinuous
   End With

This is what I have tried, but does not work!

Leave a Reply

Your email address will not be published. Required fields are marked *