Name

chartarea.Font

Synopsis

Returns the Font object representing the formatting of all the text on the chart. For example, the following code makes all of the caption, label, and legend text on the active chart bold:

Sub ChartAreaFont( )
    Dim chrt As Chart, f As Font
    ' Get the chart.
    Set chrt = ActiveChart
    ' Get the chart area font.
    Set f = chrt.ChartArea.Font
    f.Bold = True
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.