Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.charting
|
|||
|
|||
xl2007 - Reading Values and XValues
You cannot to my knowledge directly querry the XValues or Values from a chart
series. For example, this does NOT work: Sub test1() Dim i As Integer With ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1) For i = LBound(.XValues) To UBound(.XValues) Debug.Print .XValues(i) Next End With End Sub However, if you set a variant to the XValues or Values, it returns an variant array that you can querry. Prior to xl2007, the following code works: Sub test2() Dim arr As Variant Dim i As Integer With ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1) arr = .XValues For i = LBound(arr) To UBound(arr) Debug.Print arr(i) Next End With End Sub I have a large project that obtains the XValues and Values using the above code (formatted as a function). A couple of staff have upgraded to xl2007 and this code stopped working. I don't have xl2007 to experiment with. Wondering if anyone knows of a simple alternative that doesn't resort to either parsing the series formula or using a cell range and reading the cell values? Maybe using Application.Transpose and reading the return array? Or maybe I'm missing something? As mentioned above, I don't have xl2007 to experiment with. Appreciative of responses. Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
.Values / .XValues modification | Excel Discussion (Misc queries) | |||
Reading values from a closed workbook | New Users to Excel | |||
Displaying XValues and Values for chart using VBA | Charts and Charting in Excel | |||
line of best fit/reading values from graphs | Excel Discussion (Misc queries) | |||
Problem with plotting a chart when using arrays as Values and Xvalues | Charts and Charting in Excel |