I have a problem when I try to run the below code for drawing a chart form data range in Excel sheet , for example the data in column E vs. column A as Xvalue, note that the end of the data range are variable , so I declare a variable called myD as integer for first limiting the end of the data series range
So could you advice?
------------------------------------------
Sub Button9_Click()
'
'
Dim myD As Integer
myD = Columns(6).End(xlDown).Row
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""|Fr|"""
ActiveChart.SeriesCollection(1).Values = Range(Cells(1, 6), Cells(myD, 6))
ActiveChart.SeriesCollection(1).XValues = Range(Cells(1, 1), Cells(myD, 1))
End Sub
So could you advice?
------------------------------------------
Sub Button9_Click()
'
'
Dim myD As Integer
myD = Columns(6).End(xlDown).Row
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""|Fr|"""
ActiveChart.SeriesCollection(1).Values = Range(Cells(1, 6), Cells(myD, 6))
ActiveChart.SeriesCollection(1).XValues = Range(Cells(1, 1), Cells(myD, 1))
End Sub