user1270123
user1270123

Reputation: 573

How to set the title for X axis and Y axis for X-Y Scatter Plot in Excel

I have a static empty chart in Excel, I have a macro which pulls the data from the excel sheet and populates the graph in the chart. Is there a way to set the title for the X axis and the Y axis using the Chart properties in excel??

Upvotes: 0

Views: 9266

Answers (2)

brettdj
brettdj

Reputation: 55682

You can link the X axis and Y axis titles to cells, so that they automatically update when the cells change

Text below from this Microsoft Article

To easily update a chart or axis title, label, or text box that you have added to a chart, you can link it to a worksheet cell by creating a reference to that worksheet cell. Changes that you make to the worksheet cell will automatically appear in the chart.

  1. On a chart sheet or in an embedded chart, click the title, label, or text box that you want to link to a worksheet cell.
  2. In the formula bar, type an equal sign (=).
  3. Select the worksheet cell that contains the data or text that you want to display in the chart.
  4. If you want to type the reference to the worksheet cell, include the sheet name followed by an exclamation point, for example, Sheet1!F2

    Press ENTER.

Upvotes: 0

Francis P
Francis P

Reputation: 13655

Use

Chart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text

And

Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text

Upvotes: 3

Related Questions