Page 258 - Microsoft Office Excel 2003 Programming Inside Out
P. 258

Microsoft Office Excel 2003 Programming Inside Out

                             Table 10-6.  The Font Object’s Properties
                             Property         Description
                             Background	      The Background property, which is only used for text on charts, can
                                              take one of three Excel constants: xlBackgroundAutomatic (which
                                              defaults to the chart element’s setting), xlBackgroundOpaque (which
                                              makes the text box’s background appear over other chart elements),
                                              or xlBackgroundTransparent (which lets other chart element colors
                                              show through).
                             Bold	            Set to True or False, this property determines whether the font will be
                                              displayed in bold type.
                             Color            Uses the RGB property to return or set the font’s color.
                             ColorIndex       Returns or sets a font color to a color in the Excel color palette.
                             FontStyle	       Contains a string that is used to return or set the font style (for
                                              example, “Bold Italic” or “Regular”). The available styles differ
                                              depending on the font.
                             Italic	          Set to True or False, this property determines whether the text will be
                                              displayed in italics.
                             Name	            Contains a string that is used to return or set the name of the font in
                                              which the text is displayed.
                             Size             Returns or sets the size of the font, in points.
                             Strikethrough	   Set to True or False, this property determines whether the text will
                                              have a horizontal line through the middle of the text.
                             Subscript	       Set to True or False, this property determines whether the text will be
                                              formatted as subscript.
                             Superscript	     Set to True or False, this property determines whether the text will be
             Chapter 10
                                              formatted as superscript.
                             Underline	       Returns or sets the type of underlining for the selected text. The style
                                              of underlining is represented by one of these Excel constants:
                                              xlUnderlineStyleNone, xlUnderlineStyleSingle, xlUnderlineStyleDouble,
                                              xlUnderlineStyleSingleAccounting, or
                                              xlUnderlineStyleDoubleAccounting.

                             One of the fundamental strengths of Excel is the ability to create conditional formats, or for-
                             mats that reflect the value of the data in a cell. As an example, consider the series of If…Then
                             statements introduced in Chapter 5 to change the color of the active cell’s contents based on
                             the cell’s value.

                             Sub AvailableCredit()
                                 With ActiveCell
                                 If .Value = “" Then Exit Sub




                232
             Part 4:  Advanced VBA
   253   254   255   256   257   258   259   260   261   262   263