Sorry in advance, this should be a simple fix I just have zero experience with Macros in excel. I have this set up so far. The number of rows varies so I find the last row. I then want to plot data from columns A&B from A4 to LastRow and B4 to LastRow but am not sure how to do this. Thanks in advance
![]()
Sub PumpingCurve() ' ' PumpingCurve Macro ' Dim LastRow As Long With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row End With ActiveSheet.Shapes.AddChart.Select ActiveChart.ChartType = xlXYScatter ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection(1).Name = "=test2!$A$1" ActiveChart.SeriesCollection(1).XValues = "=test2!$A$4:$A$" ActiveChart.SeriesCollection(1).Values = "=test2!$B$4:$B$" End Sub
Bookmarks