aerodoc
03-16-2014, 12:06 PM
So, this works to add a series
Sub AddNewSeries()
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("B5")
.Values = ActiveSheet.Range("D5:D5")
.XValues = ActiveSheet.Range("C5:C5")
End With
End Sub
But I really need to reference the ranges as "Cells" so that I can put the values in a loop
For example, I want Range(Cells(4,5) , Cells(4,5)) instead of Range("D5:D5"). But when I do this, I get an error.
Any idea how to make this work?
Sub AddNewSeries()
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("B5")
.Values = ActiveSheet.Range("D5:D5")
.XValues = ActiveSheet.Range("C5:C5")
End With
End Sub
But I really need to reference the ranges as "Cells" so that I can put the values in a loop
For example, I want Range(Cells(4,5) , Cells(4,5)) instead of Range("D5:D5"). But when I do this, I get an error.
Any idea how to make this work?