Forum home » Delegate support and help forum » Microsoft VBA Training and help » Formatting
Formatting
Resolved · Low Priority · Version 2003
Formatting
Excel only allows 3 condiditonal formats. Is there a way in VBA to have more than this?For upcoming training course dates see: Pricing & availability
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.
Tue 1 Sep 2009: Automatically marked as resolved.
|
|
» Forum post: Vlookup |



Course updates

