VBA Modify Chart Title in Excel. Let us see how to modify existing chart title using ChartTitle object of the Chart object in Excel VBA.
VBA modify or change or update chart title using the “ChartTitle” object of the Chart object in Excel. The following code modifies the existing chart title name Sales to the Region Sales Data.
'Modify Chart Title Sub VBAF1_Modify_Chart_Title() 'Variable Declaration Dim myChart As Chart 'Define or set object Set myChart = ActiveSheet.Shapes("myColumnChart").Chart With myChart 'Check if chart as already chart .HasTitle = True 'Change or update chart title .ChartTitle.Text = "Region Sales Data" End With End Sub
Input screenshot: Here is the screenshot before running the above macro. You can see the existing chart title(Sales) which is highlighted in the below screenshot which we want to change or update or modify.
Output Screenshot: Let us see the screenshot after running the above macro. Here we see updated chart title(Region Sales Data) which we can see in the screenshot.
You can refer the following link for the step-by-step instructions.
Click on the following links of the useful resources. These helps to learn and gain more knowledge.