Share via


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

Applies to | ChAxis Object | ChChartDraw Object | ChDataLabel Object | ChDataLabels Object | ChLegend Object | ChLegendEntry Object | ChTitle Object | PivotLabel Object | Range Object | TitleBar Object

See Also | Bold Property | Italic Property | TotalFont Property