Consulting

Results 1 to 2 of 2

Thread: Label x Axis and y Axis with VBA

  1. #1

    Label x Axis and y Axis with VBA

    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.

  2. #2
    VBAX Expert Dave's Avatar
    Joined
    Mar 2005
    Posts
    835
    Location
    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
    Last edited by Aussiebear; 04-11-2023 at 03:51 PM. Reason: Adjusted the code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •