ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Chart Source Data (https://www.excelbanter.com/excel-programming/375440-chart-source-data.html)

Bill[_39_]

Chart Source Data
 


Hello Again,
I did not get a response the first time I posted this question. The
first time that has happened. Perhaps it is more difficult than I
think.

I would like to find, using VBA, the worksheet containing the data for a
chart - beginnig with the chart being active sheet. Is there an easy
way to do that?

Thanks,

Bill

*** Sent via Developersdex http://www.developersdex.com ***

Peter T

Chart Source Data
 
Hi Bill,

Need to parse a series formula. If all you want is the source worksheet
maybe this (barely tested and likely unreliable in all but 'typical'
scenarios)

Sub test()
Dim sFml As String
Dim sShtName As String
Dim v

sFml = ActiveChart.SeriesCollection(1).Formula
v = Split(sFml, ",")
sShtName = Replace(Left(v(2), InStr(v(2), "!") - 1), "'", "")

MsgBox sShtName

' Split & Replace n/a in xl97
End Sub

For more info on the series formula and infinately more reliable code

http://www.j-walk.com/ss/excel/tips/tip83.htm

Regards,
Peter T

"Bill" wrote in message
...


Hello Again,
I did not get a response the first time I posted this question. The
first time that has happened. Perhaps it is more difficult than I
think.

I would like to find, using VBA, the worksheet containing the data for a
chart - beginnig with the chart being active sheet. Is there an easy
way to do that?

Thanks,

Bill

*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 12:23 PM.

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