Retrieving XValues data

abielr

New Member
Joined
Mar 9, 2009
Messages
4
I have a line chart for which I cannot figure out how to retrieve the XValues of a series. I know how to set the XValues:

ActiveChart.SeriesCollection(1).XValues = ActiveSheet.Range("A10:20")

But I cannot retrieve this information.

Dim x As Range
Set x = ActiveChart.SeriesCollection(1).XValues
Error: "Object required"

Dim x As String
x = ActiveChart.SeriesCollection(1).XValues
Error: "Type mismatch"

Is there a way to do this?

Thanks very much.

Abiel
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,895
Hi Abiel
Welcome to the board

The XValues property returns a variant with an array of x values for a chart series.

Try:

Code:
Dim vValues As Variant
 
vValues = ActiveChart.SeriesCollection(1).XValues
 
Upvote 0

Forum statistics

Threads
1,195,748
Messages
6,011,421
Members
441,614
Latest member
TiaGtz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top