<p>I have a chart in a Worksheet in Excel and I have a macro set up so that when I change the value in a certain cell the range of data in the chart is set to <code>A2</code> down as far as the row number corresponding in this certain cell.</p>

<p>What I can't seem to be able to do is to modify the axis as the specified axis no longer covers the range of the graph i.e. the current X axis is set to:</p>

<pre><code>=Sheet1!$C$2:$C$600
</code></pre>

<p>I can't figure out how I can update this in a macro. Any help would be much appreciated.</p>

You should be able to set the XValues property in the same way you did in Lance's answer for your
other question
.
```
```
Charts("chartname").SeriesCollection(1).XValues = "=MYXAXIS"
```
```
or whatever you call the named range for the x-axis values. If you have multiple series in your chart, you'll want to change the value in SeriesCollection to refer to the right series.