PC Review


Reply
Thread Tools Rate Thread

chart series: displaying the source range

 
 
R Vaughn
Guest
Posts: n/a
 
      23rd Oct 2009
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)
 
Reply With Quote
 
 
 
 
R Vaughn
Guest
Posts: n/a
 
      24th Oct 2009
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get source data range for each series of an active chart Alan Microsoft Excel Programming 0 22nd Jul 2008 12:15 AM
x y scatter chart series ranges reset to x(range) = y(range) =?Utf-8?B?QnJha2VybTE5?= Microsoft Excel Charting 4 26th Sep 2006 11:13 PM
Displaying series list from each chart sheet in workbook =?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?= Microsoft Excel Programming 5 31st May 2006 05:36 PM
Array as chart series data source =?Utf-8?B?TWl0Y2g=?= Microsoft Excel Programming 1 19th Apr 2005 10:59 PM
Hiding or Displaying Series In a Chart =?Utf-8?B?U1BZUkVO?= Microsoft Excel Charting 1 27th Nov 2004 12:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:40 PM.