PDA

View Full Version : Label x Axis and y Axis with VBA



dhartford
12-21-2008, 11:31 AM
I'm creating the Scatter Plot chart (excel) from Access VBA. Does anyone know what property of the chart is to label the X and Y axis?

Thank you very much in advance.

Dave
12-21-2008, 07:43 PM
Not sure about Access VBA but this does it for XL VBA. HTH. Dave


With ActiveChart
'chart name
.HasTitle = True
.ChartTitle.Characters.Text = "Chart Name"
'X axis name
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "X-Axis"
'y-axis name
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Y-Axis"
End With