Excel 2010 Macro Change Chart Title

 

The Layout tab’s built-in menus let you add a title above a chart, but they do not let you change the characters in a chart title or axis title. In the Excel interface, you can double-click the chart title text and type a new title to change the title.

 

To specify a chart title in VBA, use this code:

ActiveChart.ChartTitle.Caption = “My Chart”

 

 

You can also specify the axis titles by using the Caption property. To change the axis title along the category axis:

ActiveChart.Axes(xlCategory, xlPrimary).AxisTitle.Caption = “Months”