Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
chart series: displaying the source range
I am trying to set up a message box that will display the source range for a
series in a line graph. I get a "Run-time error 438" with the following code. What is wrong? ChartObjects(1).Select x = ChartObjects(1).SeriesCollection(5).Values MsgBox (x) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
chart series: displaying the source range
R Vaughn wrote:
I am trying to set up a message box that will display the source range for a series in a line graph. I get a "Run-time error 438" with the following code. What is wrong? ChartObjects(1).Select x = ChartObjects(1).SeriesCollection(5).Values MsgBox (x) This will display the value portion of the series: Sub Lime() Dim co As ChartObject Dim sc As SeriesCollection Set co = ActiveSheet.ChartObjects(1) Set sc = co.Chart.SeriesCollection Debug.Print sc(5).Formula ' the series' value range is: MsgBox Split(sc(5).Formula, ",")(2) Stop End Sub FYI The Values property is an array, so you can't display it as a string without some treatment. Formula is a string, but I treat it like a comma-delimited array (see the output in the debug window). The "value" portion of the Formula "array" is member 2 because Split returns a zero-based array. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
chart series: displaying the source range
Thank you for your help.
"smartin" wrote: R Vaughn wrote: I am trying to set up a message box that will display the source range for a series in a line graph. I get a "Run-time error 438" with the following code. What is wrong? ChartObjects(1).Select x = ChartObjects(1).SeriesCollection(5).Values MsgBox (x) This will display the value portion of the series: Sub Lime() Dim co As ChartObject Dim sc As SeriesCollection Set co = ActiveSheet.ChartObjects(1) Set sc = co.Chart.SeriesCollection Debug.Print sc(5).Formula ' the series' value range is: MsgBox Split(sc(5).Formula, ",")(2) Stop End Sub FYI The Values property is an array, so you can't display it as a string without some treatment. Formula is a string, but I treat it like a comma-delimited array (see the output in the debug window). The "value" portion of the Formula "array" is member 2 because Split returns a zero-based array. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to get source data range for each series of an active chart | Excel Programming | |||
Displaying series list from each chart sheet in workbook | Excel Programming | |||
Chart -- Source Data... -- Series dialog window | Charts and Charting in Excel | |||
Array as chart series data source | Excel Programming | |||
Hiding or Displaying Series In a Chart | Charts and Charting in Excel |