VBA - reference to a chart

  • Thread starter Thread starter yusoon
  • Start date Start date
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
 
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
 
Back
Top