I tried to record a makro for the proccess and then modify it with "last row". Which i saw you use in the following
Set Newcht = .Shapes.AddChart(xlColumnStacked) 'you can add chart position and size here too.
Newcht.Chart.SetSourceData Source:=.Range("A5:C" & LastRow)
for the linechart i got the following gode:
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='Ark2'!$D$5"
ActiveChart.SeriesCollection(1).Values = "='Ark2'!$D$6:$D$63"
ActiveChart.SeriesCollection(1).XValues = "='Ark2'!$E$6:$E$63"
i got
ActiveChart.SeriesCollection(1).Name = "='Ark2'!$D$5"
ActiveChart.SeriesCollection(1).Values = "='Ark2'!$D$6: LastRow"
ActiveChart.SeriesCollection(1).XValues = "='Ark2'!$E$6: Last row"
didnt work
i tried adding xlLine to your line.
i got :
Set Newcht = .Shapes.AddChart(xlLine) 'you can add chart position and size here too.
Newcht.Chart.SetSourceData Source:=.Range("D6:E" & LastRow)
Didnt work either ..
Set Newcht = .Shapes.AddChart(xlColumnStacked) 'you can add chart position and size here too.
Newcht.Chart.SetSourceData Source:=.Range("A5:C" & LastRow)
for the linechart i got the following gode:
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='Ark2'!$D$5"
ActiveChart.SeriesCollection(1).Values = "='Ark2'!$D$6:$D$63"
ActiveChart.SeriesCollection(1).XValues = "='Ark2'!$E$6:$E$63"
i got
ActiveChart.SeriesCollection(1).Name = "='Ark2'!$D$5"
ActiveChart.SeriesCollection(1).Values = "='Ark2'!$D$6: LastRow"
ActiveChart.SeriesCollection(1).XValues = "='Ark2'!$E$6: Last row"
didnt work
i tried adding xlLine to your line.
i got :
Set Newcht = .Shapes.AddChart(xlLine) 'you can add chart position and size here too.
Newcht.Chart.SetSourceData Source:=.Range("D6:E" & LastRow)
Didnt work either ..