Hi,
I have a spreadsheet with quite a few charts.....
What I would like to do is change the value for the chart options:
1. X-axis value
2. Name (of the series) value
3. The values for the series themselves
Here is the code that the macro recorder produced (apart from the With's)
This works for the Xvalues but not for values and Name, the error I am receiving is the followingCode:ActiveSheet.ChartObjects("Chart 1").Activate With ActiveChart .ChartArea.Select .SeriesCollection(1).XValues = "=DATA!R14C1:R25C1" .SeriesCollection(1).Values = "=DATA!R14C4:R25C4" .SeriesCollection(1).Name = "=DATA!R2C4" .SeriesCollection(2).XValues = "=DATA!R14C1:R25C1" .SeriesCollection(2).Values = "=DATA!R14C5:R25C5" .SeriesCollection(2).Name = "=DATA!R2C5" end with
"Unable to set the values property of the series class"
Does anybody know why? or have any idea of other ways of changing the series values.. (The charts aren't embedded, I assume this makes a diffence i.e. whether you can use Chartobject or Charts !!)
I have even used the following
But that didn't work either (Seems to only work if you add a series, not amending an already existing one).... There must be a way to do this !!!! (He says)Code:.seriescollection(1).Name = Worksheets("DATA").Range("A1:A25")
Thanks for any help
Steve




Reply With Quote