When inserting a new chart:
Set myChart = ActiveSheet.Shapes.AddChart(xlLine, 500, 200).Chart
When adjusting an old chart:
'Set myChart = Sheets(1).
With myChart
.Top = 50
.Left = 50
End With
To Name the Series:
.SeriesCollection(1).Name = Range("B" & lngStartRow - 1).Value
.SeriesCollection(2).Name = Range("C" & lngStartRow - 1).Value
To change the series data itself:
set CHARTDATA = range("A1:A2").values
myChart.Chart.SetSourceData Source:=CHARTDATA
To change the x-axis on which the dataseries are placed, try this, dependant on the values in A1 and A2:
With myChart.Chart.Axes(xlCategory)
.MinimumScale = ActiveSheet.Range("A1").Value
.MaximumScale = ActiveSheet.Range("A2").Value
End With
Note that I haven't had time to check the last series data, let me know if it works and i can update later if not.
Was this what you were looking for?