Answers for "vba format conditions save"

0

vba format conditions save

Sub ConditionalFormattingExample()

‘Define Range
Dim MyRange As Range
Set MyRange = Range(“A1:A10”)

‘Delete Existing Conditional Formatting from Range
MyRange.FormatConditions.Delete

‘Apply Conditional Formatting
MyRange.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
        Formula1:="=100", Formula2:="=150"
MyRange.FormatConditions(1).Interior.Color = RGB(255, 0, 0)
End Sub
Posted by: Guest on June-28-2021

Browse Popular Code Answers by Language