Microsoft Office Tutorials and References
In Depth Information
19.4.6 The Font Object
Range("A1").Comment.Visible = True
DoEvents
Do: Loop Until Timer - tm > 3
Range("A1").Comment.Visible = False
19.4.6 The Font Object
The Font property of a Range object returns a Font object. Font objects are used to control the
characteristics of the font (font name, size, color, and so on) used in the range.
The properties of the Font object are shown in Table 19-5 .
Tabl e 19-5. Properties of the Fo nt Object
Application
FontStyle
Size
Background
Italic
Strikethrough
Bold
Name
Subscript
Color
OutlineFont
Superscript
ColorIndex
Parent
Underline
Creator
Shadow
Recall that the Characters property can be used to format portions of text.
19.4.7 The FormatConditions Collection
Excel allows us to apply conditional formatting to a cell (or a range of cells). A conditional format
is a format that is applied if and only if certain conditions are met by the contents of the cell. For
instance, we may want to make a number red if it is negative, black if it is positive, or green if it is
0. This requires three conditional formats.
The FormatConditions property of a Range object returns a FormatConditions collection that can
contain up to three FormatCondition objects, each of which represents a conditional format.
The Add method of the FormatConditions collection is used to add FormatCondition objects to the
collection. However, attempting to add more than three such objects will generate an error. The
syntax for the Add method is:
FormatConditionsObject .Add( Type , Operator , Formula1 , Formula2 )
The required Type parameter specifies whether the conditional format is based on the value in the
cell or an expression. It can be either of the following XlFormatConditionType constants:
Enum XlFormatConditionType
xlCellValue = 1
xlExpression = 2
End Enum
When Type is xlCellValue , the Operator parameter specifies the operator to use with that
value. If Type is xlExpression , the Operator argument is ignored. The value of Operator
is one of the following constants:
Enum XlFormatConditionOperator
xlBetween = 1
 
Search JabSto ::




Custom Search