If you want to add chart title using VBA. Try this code-
Sub change_chart_title_using_vba()
Dim cht As Chart
' change chart name here
Set cht = Sheets("Sheet1").ChartObjects("Chart 3").Chart
With cht
.HasTitle = True
.ChartTitle.Text = "Monthly View" 'chart title
.ChartTitle.Font.Name = "Arial"
.ChartTitle.Font.Size = 12
.ChartTitle.Font.Color = RGB(255, 10, 35)
End With
End Sub
Sub change_chart_title_using_vba()
Dim cht As Chart
' change chart name here
Set cht = Sheets("Sheet1").ChartObjects("Chart 3").Chart
With cht
.HasTitle = True
.ChartTitle.Text = "Monthly View" 'chart title
.ChartTitle.Font.Name = "Arial"
.ChartTitle.Font.Size = 12
.ChartTitle.Font.Color = RGB(255, 10, 35)
End With
End Sub
No comments:
Post a Comment