Welcome to the forum.
Please take a few minutes to read the forum rules, and then edit your post to add code tags.
Welcome to the forum.
Please take a few minutes to read the forum rules, and then edit your post to add code tags.
Entia non sunt multiplicanda sine necessitate
I added the above code tags - Is this what you were referring to? Sorry for the mess up.
I change the code slightly so it should be easier to adapt for future use.
![]()
Sub Macro3() ' ' Macro3 Macro ' Dim rngXData As Range Dim rngYData As Range ' Set rngXData = Range("A2", Cells(Rows.Count, 1).End(xlUp)) Set rngYData = rngXData.Offset(0, 1) With ActiveSheet.Shapes.AddChart.Chart Do While .SeriesCollection.Count > 0 ' remove any series added automatically .SeriesCollection(1).Delete Loop With .SeriesCollection.NewSeries .Values = rngYData .XValues = rngXData .Name = "='" & ActiveSheet.Name & "'!" & rngYData.Offset(-1, 0).Cells(1, 1).Address End With .ChartType = xlXYScatterSmoothNoMarkers End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks