Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 504
Default Macro to find a charts data source

What property can I refer to in a macro to get the data source of a chart.
Any data source would do, be it a title or value anything that refers to one
or some of the cells a chart gets it data from..

Thanks,
Kevin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Macro to find a charts data source

DataSeries is the plot values.

"Kevin" wrote:

What property can I refer to in a macro to get the data source of a chart.
Any data source would do, be it a title or value anything that refers to one
or some of the cells a chart gets it data from..

Thanks,
Kevin

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Macro to find a charts data source

Hi,

To discover the ranges used in a charts data series you would need to parse
the Formula property of the series.
John Walkenbach has a class for parsing the formula.
http://spreadsheetpage.com/index.php..._chart_series/

Activechart.seriescollection(1).Formula

which will return you something like this.

=SERIES(Sheet1!$B$1,Sheet1!$A$2:$A$5,Sheet1!$B$2:$ B$5,1)

You can read the .Values and .XValues of the series in to variant arrays.
But this will be numbers not cell addresses.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Kevin" wrote in message
...
What property can I refer to in a macro to get the data source of a chart.
Any data source would do, be it a title or value anything that refers to
one
or some of the cells a chart gets it data from..

Thanks,
Kevin


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 504
Default Macro to find a charts data source

THANK YOU!!!

I knew it had to be something simple. :-)

Kevin

"Andy Pope" wrote:

Hi,

To discover the ranges used in a charts data series you would need to parse
the Formula property of the series.
John Walkenbach has a class for parsing the formula.
http://spreadsheetpage.com/index.php..._chart_series/

Activechart.seriescollection(1).Formula

which will return you something like this.

=SERIES(Sheet1!$B$1,Sheet1!$A$2:$A$5,Sheet1!$B$2:$ B$5,1)

You can read the .Values and .XValues of the series in to variant arrays.
But this will be numbers not cell addresses.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Kevin" wrote in message
...
What property can I refer to in a macro to get the data source of a chart.
Any data source would do, be it a title or value anything that refers to
one
or some of the cells a chart gets it data from..

Thanks,
Kevin



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple charts from 1 source data Sduduzo Charts and Charting in Excel 2 February 3rd 10 06:36 PM
Editing Source Data in Charts F. Lawrence Kulchar Charts and Charting in Excel 1 November 5th 06 03:18 PM
extending source data in several charts Mike Charts and Charting in Excel 4 November 29th 05 05:37 AM
Macro to Update Charts Source Data [email protected] Charts and Charting in Excel 1 October 18th 05 03:22 AM
Charts not recognizing source data if original linked data is changed. JLC Charts and Charting in Excel 3 October 14th 05 01:29 AM


All times are GMT +1. The time now is 02:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"