Name

chart.ChartTitle

Synopsis

Returns the ChartTitle object representing the title displayed on the chart. Make sure the HasTitle property is True before using this object. For example, the following code adds a title to a chart:

Sub AddTitle(  )
      Dim chrt As Chart, ct As ChartTitle
      Set chrt = Charts("New Chart")
      chrt.HasTitle = True
      Set ct = chrt.ChartTitle
      ct.Caption = "New Title"
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.