Dynamic input for Chart gives error9 but seems to do his job to...

T

the dude

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
 

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

Similar Threads


Top