On Aug 6, 8:34 am, "Peter T" <peter_t@discussions> wrote:
> <harm.char...@gmail.com> wrote in message
>
> news:9fedd499-05c6-4fb6-94bc-(E-Mail Removed)...
>
>
>
> > On Aug 5, 4:58 pm, Barb Reinhardt
> > <BarbReinha...@discussions.microsoft.com> wrote:
> >> Do you have 4 "?
> >> --
> >> HTH,
> >> Barb Reinhardt
>
> >> "harm.char...@gmail.com" wrote:
> >> > Hi,
>
> >> > I recorded a copy of achartand paste to new location on a work sheet
> >> > and recorded the value for thechart. I'm trying to use vba to do
> >> > this, but the following code has an error. What is wrong with it.
> >> >
Code:
> >> > ActiveChart.SeriesCollection(1).XValues = "=reject!R2C" & Fcol + 1 &
> >> > ":R3C" & Lcol - 2 & """"
> >> >
>
> >> > Error Unable to set XLValues of Series class.
>
> > HI,
>
> > This is the recorded values with the change.
> > ActiveChart.SeriesCollection(1).XValues = "=reject!R2C37:R2C49"
> > This is the vba code I thought would work.
> > ActiveChart.SeriesCollection(1).XValues = "=reject!R2C" & Fcol + 1 &
> > ":R3C" & Lcol - 2 & """
>
> > The Fcol and Lcol are correct and when cursor over them show the
> > correct value.
>
> > Debug show
> > =reject!R2C20:R3C32"
>
> > But still get error as above.
>
> That looks like a 2(row) x 13(col) range, but it should be a single row or
> column. Looks like either "reject!R2C" or ":R3C" is wrong, I guess the
> latter should be ":R2C"
>
> Regards,
> Peter T
You are correct, however after correcting it I still receive the
error.
"Unable to set name property of the series class".
I do not know if the way I have the formula formatted is my problem
What I do is copy the current chart to the right (2 columns) and then
change the property of the series class for the chart that was copied.
I recorded the change of the series class and was trying to the code
as stated above using the "Fcol" for the new location where the data
for the chart starts and "Lcol" for wher the data ends. I hope this
will be a little clearer.