VBA - reference to a chart


Y

yusoon

dear community:
Everytime I update the chart data range, I have to Select i
first:

ActiveSheet.ChartObjects("Chart 1").Select

ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R35C13:R" & iROWS
"C13"
ActiveChart.SeriesCollection(1).Values = "=Sheet1!R35C19:R" & iROWS
"C19"

ActiveChart.SeriesCollection(2).XValues = "=Sheet1!R35C13:R" & iROWS
"C13"

ActiveChart.SeriesCollection(2).Values = "=Sheet1!R35C20:R" & iROWS
"C20"


I tried this but not working:

Sheet("Sheet1").ChartObjects("Chart 1").SeriesCollection(1).XValues
"=Sheet1!R35C13:R" & iROWS & "C13"


Thanks
 
Ad

Advertisements

Y

yusoon

Sorry i mean:
Sheet("Sheet1").ChartObjects("Chart 1").SeriesCollection(1).XValues
"=Sheet1!R35C13:R" & iROWS & "C13"

Worksheets("sheet1").ChartObjects("Chart 1").Chart. _
SeriesCollection(1).Value = "=Sheet1!R1C1:R20C1"


It gives me run-time error '438' object doesn't support this propert
or metho
 
Ad

Advertisements


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

Top