Hi, I am quite new to VBA and I have been watching tutorials and reading forums without any clear answer... here is my problem:
I have a variable number of series (represented in columns side-by-side as) and each one contains a distinct x and y value.
Also, for each serie there's a number variable of data, so in Series1 there're 100 full rows and Series2 88 full rows, and so on in other series.
In order to get a graphical view of the location of each of the values I want to insert them all into a plot. I know it should be a xlXYScatter plot, but for me it would be ideal if all the values represented were equal in shape as is the case with xlBubble (although the z-dimensional value should be equal in all cases).
I have managed to make the XYscatted plot with only one set of values, and I don't know how to add some more...
Can it be programmed in such a way that it goes series by series (variable) and keeping always all the values represented with the same style?
Private Sub CommandButton1_Click()
Dim xrng As Range
Dim yrng As Range
Set xrng = Range("B2:B100")
Set yrng = Range("C2:C100")
Dim Chart1 As Chart
Set Chart1 = Charts.Add
With Chart1
.ChartType = xlXYScatter
.SeriesCollection.NewSeries
.SeriesCollection(1).Name = "=""Values"""
.SeriesCollection(1).XValues = xrng
.SeriesCollection(1).Values = yrng
End With
End Sub
Many thanks!
Ramon
Bookmarks