I would like to use SeriesCollection.Extend method to extend the range of a chart. Worksheet(1) has the values
Column A | Column B |
---|---|
DATE | |
6/1/2023 | 1 |
6/2/2023 | 4 |
6/3/2023 | |
6/4/2023 |
The first 3 rows/columns are charted as "Chart 1". I want to extend the chart to include row 4 using the SeriesCollection.Extend method.
The macro:
Sub ExtendTrial()
Charts("Chart 1").SeriesCollection.Extend _
Source:=Worksheets("Sheet1").Range("$A$5:$B$5")
End Sub
gives a "Subscript out of range" error. The macro does not seem to allow me to add the xlColumn parameter