K
Keith
Hello,
I have VBA code that creats data and places it into a
worksheet. Now, I need to plot it into an existing line
graph in a Chart. Using "help" I located code that shows
how to extend an existing range, and how to add a new
line, but have not found anything that shows how to
replace an existing line. It seems to me it will require
two steps: first to point the chart to the worksheet range
with the data, and then to point the chart to the
worksheet range containing the X axis labels.
Below are the code examples I found for extend and add.
Can you suggest code described above?
Code for Extend...
Charts("Chart4").SeriesCollection.Extend _
Source:=Worksheets("Sheet1").Range("B2:B203")
Code for add...
Charts(1).SeriesCollection.Add _
Source:=Worksheets("sheet1").Range("B2:B203")
thanks
Keith
I have VBA code that creats data and places it into a
worksheet. Now, I need to plot it into an existing line
graph in a Chart. Using "help" I located code that shows
how to extend an existing range, and how to add a new
line, but have not found anything that shows how to
replace an existing line. It seems to me it will require
two steps: first to point the chart to the worksheet range
with the data, and then to point the chart to the
worksheet range containing the X axis labels.
Below are the code examples I found for extend and add.
Can you suggest code described above?
Code for Extend...
Charts("Chart4").SeriesCollection.Extend _
Source:=Worksheets("Sheet1").Range("B2:B203")
Code for add...
Charts(1).SeriesCollection.Add _
Source:=Worksheets("sheet1").Range("B2:B203")
thanks
Keith