ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to return the data a chart is based on (https://www.excelbanter.com/excel-programming/288289-code-return-data-chart-based.html)

dracstorey

Code to return the data a chart is based on
 
Anone know of an method in VBA which will return the data series an
existing graph or chart is based on?

I cannot I find any code to return the data series that a chart is
based on. (i.e. return "C4:C7"). It seems an obvious thing to want to
do but ...


Andrew


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


Tom Ogilvy

Code to return the data a chart is based on
 
See John Walkenbach's discussion of this:

http://j-walk.com/ss/excel/tips/tip83.htm
A Class Module to Manipulate a Chart SERIES

--
Regards.
Tom Ogilvy


dracstorey wrote in message
...
Anone know of an method in VBA which will return the data series an
existing graph or chart is based on?

I cannot I find any code to return the data series that a chart is
based on. (i.e. return "C4:C7"). It seems an obvious thing to want to
do but ...


Andrew


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




dracstorey[_2_]

Code to return the data a chart is based on
 
Many thanks Tom. I'm glad he says there is a serious flaw (I thought I
was going mad!). I will try his code and hopefully it will solve the
problem.

Thanks again

Andrew


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


dracstorey[_3_]

Code to return the data a chart is based on
 
Problem nearly solved. I have very nearly integerated the code into
mine. Just a couple of bugs for me to deal with but therange is indeed
returned!

Many thanks

Andrew


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



All times are GMT +1. The time now is 03:59 AM.

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