Saturday, 15 November 2014

Finding commas and apply formatting

Sub FindCommas ()
    Columns("A:A").Select
    Range("A1").Activate
    Selection.FormatConditions.Add Type:=xlTextString, String:=",", TextOperator:=xlContains
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent6
        .TintAndShade = 0.599963377788629
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Range("A1").Select

End Sub

No comments:

Post a Comment