View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
lee.christopher lee.christopher is offline
external usenet poster
 
Posts: 2
Default Changing XValues and Values in a chart

I have a subroutine that makes a scatterplot for ranges (.XValues & .Values)
that can't be predicted.

I want to add my own ranges to the scatterplot, for example by:

Dim XValuesToAddTo as variant
With ActiveChart.SeriesCollection(1)
XValuesToAddTo = .XValues
XValuesToAddTo = XValuesToAddTo & some new ranges
.XValues = XValuesToAddTo
etc

There are several posts on the web that say that this sort of thing doesn't
work, but there's no explanation and nobody has proposed another way of
doing it.

It's a bit like assigning a range to a variable: you need to know that this
only works for the .Cells property, but nobody seems to know why. Perhaps
XValues has some property we don't know about.

Can anybody explain what's going on in this kind of situation, or is Excel
VBA just flaky in this area?

Regards