Laura has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Formatting
Excel only allows 3 condiditonal formats. Is there a way in VBA to have more than this?
RE: Formatting
Hi Laura,
Thank you for your question.
I have typed some code below to show you how to add more than three conditions to a range of cells:
Range("H10:H529").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=10000", Formula2:="=12000"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.ColorIndex = 7
.TintAndShade = 0
End With
If you then copy and paste this code and change the conditions such as the range of the numbers or the Operator(> < etc.)
In the VBA window use Help to see the ColorIndex numbers.
I hope this answers your question.