If you want to add or format axis titles. Try this code
Sub add_axis_titles()
Dim cht As Chart
' change chart name here
Set cht = Sheets("Sheet1").ChartObjects("Chart 3").Chart
With cht.Axes(xlCategory, xlPrimary)
.HasTitle = True
.AxisTitle.Text = "Reps"
.AxisTitle.Font.Name = "Arial"
.AxisTitle.Font.Size = 8
.AxisTitle.Font.Color = RGB(255, 10, 35)
End With
With cht.Axes(xlValue, xlPrimary)
.HasTitle = True
.AxisTitle.Text = "Ranks"
.AxisTitle.Font.Name = "Arial"
.AxisTitle.Font.Size = 8
.AxisTitle.Font.Color = RGB(0, 0, 128)
End With
End Sub
Sub add_axis_titles()
Dim cht As Chart
' change chart name here
Set cht = Sheets("Sheet1").ChartObjects("Chart 3").Chart
With cht.Axes(xlCategory, xlPrimary)
.HasTitle = True
.AxisTitle.Text = "Reps"
.AxisTitle.Font.Name = "Arial"
.AxisTitle.Font.Size = 8
.AxisTitle.Font.Color = RGB(255, 10, 35)
End With
With cht.Axes(xlValue, xlPrimary)
.HasTitle = True
.AxisTitle.Text = "Ranks"
.AxisTitle.Font.Name = "Arial"
.AxisTitle.Font.Size = 8
.AxisTitle.Font.Color = RGB(0, 0, 128)
End With
End Sub
No comments:
Post a Comment