Macro producing chart from variable length column
I'm trying to produce a chart in excel from variable length column using a
macro. I find the bottom of the column and assign the row number to variable
K. I then want to assign the SeriesCollection XValues and Values but can't
seem to do it using the Cells notation as shown below. Is there another way
to approach this using the variable K for the last row in the range?
ActiveChart.SeriesCollection(1).XValues =
ActiveSheet.Range(ActiveSheet.Cells(2, 1), ActiveSheet.Cells(K, 1))
Thanks
|