Microsoft Office Tutorials and References
In Depth Information
19.4.8 The Interior Object
.FormatConditions.Add xlExpression, , _
Range("A1").Value = Range("A2").Value
.FormatConditions(1).Interior.Color = _
RGB(0, 0, 255)
.FormatConditions.Add xlExpression, , _
Range("A1").Value <> Range("A2").Value
.FormatConditions(2).Interior.Color = _
RGB(255, 0, 0)
End With
As the previous examples show, the actual formatting is done by setting some of the properties of
children of the FormatCondition object. In particular, the Borders, Font, and Interior properties
return child objects of the same name, whose properties can be set to indicate the desired
formatting.
Note finally that an existing FormatCondition object can be deleted using the Delete method of the
FormatConditions collection, and it can be changed using the Modify method of the
FormatCondition object. The Modify method has the syntax:
FormatConditionObject .Modify( Type , Operator , Formula1 , Formula2 )
where the parameters are identical to those of the Add method.
19.4.8 The Interior Object
The Interior object represents the characteristics of the interior region of a cell (or range of cells).
The Interior object has only a handful of properties (and no methods), as described in this section.
19.4.8.1 Color and ColorIndex properties
These properties are analogous to the properties by the same name of the Borders object,
discussed earlier. They set the interior of a cell (or cells) to the color specified.
19.4.8.2 Pattern property
This property returns or sets the interior pattern. It can be one of the following XlPattern
constants:
Enum XlPattern
xlPatternVertical = -4166
xlPatternUp = -4162
xlPatternNone = -4142
xlPatternHorizontal = -4128
xlPatternGray75 = -4126
xlPatternGray50 = -4125
xlPatternGray25 = -4124
xlPatternDown = -4121
xlPatternAutomatic = -4105
xlPatternSolid = 1
xlPatternChecker = 9
xlPatternSemiGray75 = 10
xlPatternLightHorizontal = 11
xlPatternLightVertical = 12
xlPatternLightDown = 13
xlPatternLightUp = 14
xlPatternGrid = 15
xlPatternCrissCross = 16
Search JabSto ::




Custom Search