Font Property

Microsoft Office Web Components Object Model

Font Property

       

Returns a ChFont, Font, or PivotFont object that represents the font for the specified object (the returned object type depends on the object to which this property is applied).

expression.Font

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example sets the number format and font for the active cell.

Sub SetFont()

   Dim rngCurrentCell

   Set rngCurrentCell = Spreadsheet1.ActiveCell

   rngCurrentCell.NumberFormat = "0.###"

   rngCurrentCell.Font.Color = "Blue"

   rngCurrentCell.Font.Name = "Times New Roman"

End Sub