ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Passing a named range to a chart/series object (https://www.excelbanter.com/excel-programming/299228-passing-named-range-chart-series-object.html)

CraigBarton

Passing a named range to a chart/series object
 
I am trying to create a scrolling chart to act as a window on tim
series data. I can do this by defining a named range with an offse
linked to a scroll bar.
eg Channel1 =OFFSET(Inverse!$D$1,Graph!$C$2,1,Graph!$C$3,1)

the full data set starts at D1 and a subset is defined calle
'channel1'
where C2 holds the start of the subset of data I want to chart and C
the number of lines of data (eg a window on the time series). Both C
and C3 are linked to scroll bars allowing me to scroll through the dat
with a variable sized window.

A chart is then constructed that uses the named range channel1.

I actually have 16 channels of data and want to be able to turn on an
off which ones are displayed in the graph at will. One way to do thi
is write some code to alter which named range the chart/series objec
is using. My problem is that when I refer to the named range

Worksheets("Graph").ChartObjects(1).Activate
ActiveChart.SeriesCollection.Add _
Source:=Worksheets("Inverse").range("graphit.xls!c han4")

Excel transfers the current range associated with the named rang
rather than the indirect reference to the named range and so when
change the contents of the named range it is not reflected in th
chart.

How do I stop excel from interpreting "graphit.xls!chan1" as D1:D20
and take me literally?

Or do you know of a pre-existing solution to my scroll graph wit
selectable channels probelm?

Yours hopefully
Crai

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com