View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
the dude the dude is offline
external usenet poster
 
Posts: 1
Default Dynamic input for Chart gives error9 but seems to do his job to...

I am currently also making such a macro. I place a cel with a number of
datalines that hold X-values.

I made a macro and am trying to changing the range of the X-axis.

I can't seem to use a variable in the command.

This is the commmand:

ActiveChart.SetSourceData Source:=Sheets("1").Range("A2:B" & bereik + 2),
PlotBy:= _

xlColumns

** ActiveChart.SeriesCollection(1).XValues = _

Worksheets("Blad1").Range("A3:A" & bereik + 2)

ActiveChart.SeriesCollection(1).Values = _

Worksheets("Blad1").Range("B3:B" & bereik + 2)

It creates an error 9 at **. But i do get a graph containing the wright
values.

so it seems to work and fail at the same time.

Do you have an idea of what my problem could be?

THX