Adds major gridlines, title, and x-axis labels to an embedded chart
Public Sub SetXAxis()
Dim myAxis As Axis
Set myAxis = ActiveSheet.ChartObjects(1).Chart.Axes(xlCategory, xlPrimary)
With myAxis 'Set properties of x-axis
.HasMajorGridlines = True
.HasTitle = True
.AxisTitle.Text = "My Axis"
.AxisTitle.Font.Color = RGB(1, 2, 3)
.CategoryNames = Range("C2:C11")
.TickLabels.Font.Color = RGB(11, 12, 13)
End With
End Sub
Related examples in the same category