ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   How can I extract the XValues Formual String (https://www.excelbanter.com/charts-charting-excel/228385-how-can-i-extract-xvalues-formual-string.html)

Dan Thompson

How can I extract the XValues Formual String
 
This is very frustrating I currently have this code

Sub Test()
Dim X
X = ActiveChart.SeriesCollection(1).Formula
Debug.Print X
End Sub

The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)
which is what I want however ........

When I try this code

Sub Test()
Dim B
B = ActiveChart.SeriesCollection(1).XValues.Formula
Debug.Print B
End Sub

I get a runtime error 424 Object Requiered

What am I doing wrong Surely there is a method to return the formula string
value of the XValues of a chart series ??

Dan Thompson

Andy Pope

How can I extract the XValues Formual String
 
Hi,

Only the series has a formula property. You will need to parse the formula
to get the xvalues part.
John Walkenbach has created a class to do this
http://spreadsheetpage.com/index.php..._chart_series/

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Dan Thompson" wrote in message
...
This is very frustrating I currently have this code

Sub Test()
Dim X
X = ActiveChart.SeriesCollection(1).Formula
Debug.Print X
End Sub

The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)
which is what I want however ........

When I try this code

Sub Test()
Dim B
B = ActiveChart.SeriesCollection(1).XValues.Formula
Debug.Print B
End Sub

I get a runtime error 424 Object Requiered

What am I doing wrong Surely there is a method to return the formula
string
value of the XValues of a chart series ??

Dan Thompson




All times are GMT +1. The time now is 05:42 PM.

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