Chart data ranges

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

I am trying to allow users to plot data for different products on a
single chart. The macro calculates the data ranges and then assigns
the XValues and Values to the appropriate series of the chart by
overwriting the previously assigned series values. Sometimes the macro
works perfectly and the chart is updated; sometimes I get run-time
error 1004: "Unable to set the XValues property of the series class".

I've checked; the selected data range is correct for each product and
the format of the series value that I am trying to assign is
consistent and is in RC format.

Could anyone give me a hint as to what is happening and how to fix
this?

Regards, Alan
 
What about the data being replaced? If it contains only non-plottable values
(i.e., blanks or errors) then VBA cannot access the Values and XValues in
order to replace them. This is a problem for XY and Line charts, so you
could temporarily change the series type to Area or Column, change the data
range, and change the chart type back.

- Jon
 
Thanks Jon. There doesn't seem to be any blanks of errors in the data
but converting from XY to columns and then back again after the ranges
have been changed seems to work a treat. All I can't figure out is
why!?

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top