hi there
Im trying to update charts in excel using named ranges. To simplify lets say that the x-axis comprises 12 months (jan -> dec) and the y-axis has 2 sets of data, a 'target' series and an 'actual' series.
Lets say that the values for my 'target' data series are found at "=Sheet1!$C$2:$C$10".
Then, in the macro:
ActiveChart.SeriesCollection(1).Values = "=Sheet1!$C$2:$C$10"
ActiveChart.SeriesCollection(1).Name="=""Target"""
This does it. My problem is that i am wanting to use named ranges instead of ["=Sheet1!$C$2:$C$10"].
I have attempted the following:
***
ActiveWorkbook.Names.Add Name:="target1", ReferToR1C1:="=Sheet1!$C$2:$C$10"
ActiveChart.SeriesCollection(1).Values = "" & target1 & ""
ActiveChart.SeriesCollection(1).Name="=""Target"""
***
but this doesnt work. No error message but the values are just not being associated with the graph. Any corrections, ideas or help would be greatly appreciated.
Thank you
Im trying to update charts in excel using named ranges. To simplify lets say that the x-axis comprises 12 months (jan -> dec) and the y-axis has 2 sets of data, a 'target' series and an 'actual' series.
Lets say that the values for my 'target' data series are found at "=Sheet1!$C$2:$C$10".
Then, in the macro:
ActiveChart.SeriesCollection(1).Values = "=Sheet1!$C$2:$C$10"
ActiveChart.SeriesCollection(1).Name="=""Target"""
This does it. My problem is that i am wanting to use named ranges instead of ["=Sheet1!$C$2:$C$10"].
I have attempted the following:
***
ActiveWorkbook.Names.Add Name:="target1", ReferToR1C1:="=Sheet1!$C$2:$C$10"
ActiveChart.SeriesCollection(1).Values = "" & target1 & ""
ActiveChart.SeriesCollection(1).Name="=""Target"""
***
but this doesnt work. No error message but the values are just not being associated with the graph. Any corrections, ideas or help would be greatly appreciated.
Thank you