Hello,
So here is the setup. I have around 80 sets of data. Each data set is contained in its own tab. I would like to plot all of each data set and then two specific parts of the data set on one smooth continuous no marker scatter plot. The data sets vary in length and so do the partial sections of data. All the data sets are organized the same way in their respective worksheets. The cells to start and end the selected sections of data are specified within a cell in the worksheet (i.e. cell Z2 contains text K273 and so on). The actual piece of code that gets the error is
ActiveChart.SeriesCollection(1).XValues = ActiveSheet.Range("K3").End(xlDown)
Below is my entire code. I am sure that I will have a similar problem with the next line once this is fixed but it should just be the same problem.
Sub CreateChart()
ActiveSheet.Shapes.AddChart.Select
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = "Smoothed Stress vs. Strain"
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "Whole Test"
ActiveChart.SeriesCollection(1).XValues = ActiveSheet.Range("K3").End(xlDown)
ActiveChart.SeriesCollection(1).Values = ActiveSheet.Range("J3").End(xlDown)
SelectActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Name = "Total Integrated Curve"
ActiveChart.SeriesCollection(2).XValues = ActiveSheet.Range("K3", Range("Y2").Value.Select)
ActiveChart.SeriesCollection(2).Values = ActiveSheet.Range("J3", Range("Y3").Value.Select)
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).Name = "Brittle Curve"
ActiveChart.SeriesCollection(3).XValues = ActiveSheet.Range("K3", Range("Z2").Value.Select)
ActiveChart.SeriesCollection(3).Values = ActiveSheet.Range("J3", Range("Z3").Value.Select)
End Sub
So here is the setup. I have around 80 sets of data. Each data set is contained in its own tab. I would like to plot all of each data set and then two specific parts of the data set on one smooth continuous no marker scatter plot. The data sets vary in length and so do the partial sections of data. All the data sets are organized the same way in their respective worksheets. The cells to start and end the selected sections of data are specified within a cell in the worksheet (i.e. cell Z2 contains text K273 and so on). The actual piece of code that gets the error is
ActiveChart.SeriesCollection(1).XValues = ActiveSheet.Range("K3").End(xlDown)
Below is my entire code. I am sure that I will have a similar problem with the next line once this is fixed but it should just be the same problem.
Sub CreateChart()
ActiveSheet.Shapes.AddChart.Select
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = "Smoothed Stress vs. Strain"
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "Whole Test"
ActiveChart.SeriesCollection(1).XValues = ActiveSheet.Range("K3").End(xlDown)
ActiveChart.SeriesCollection(1).Values = ActiveSheet.Range("J3").End(xlDown)
SelectActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Name = "Total Integrated Curve"
ActiveChart.SeriesCollection(2).XValues = ActiveSheet.Range("K3", Range("Y2").Value.Select)
ActiveChart.SeriesCollection(2).Values = ActiveSheet.Range("J3", Range("Y3").Value.Select)
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).Name = "Brittle Curve"
ActiveChart.SeriesCollection(3).XValues = ActiveSheet.Range("K3", Range("Z2").Value.Select)
ActiveChart.SeriesCollection(3).Values = ActiveSheet.Range("J3", Range("Z3").Value.Select)
End Sub