I feel like I’m missing the obvious… I have the following code to wipe-out and re-generate a chart (XY Scatter) based on ranges of data.. I have many columns of “X” points, and one column of “Y” points that I want to use for each set of “X” points. I can add all the “X” points, but don’t know where to add the “Y” points? After the routine runs and I go check chart->sourcedata->series tab, all the “Y Values” are set to “={1}”
thanks!
..dane
Public Sub subPopulateChartDataSeries() Dim rngXPoints As Range Dim serSeries As Series ' clear the chart datapoints While Chart1.SeriesCollection.Count > 0 Chart1.SeriesCollection(1).Delete Wend ' Add all the new datapoints For Each rngXPoints In Range("xpoints").Columns Set serSeries = Chart1.SeriesCollection.NewSeries serSeries.XValues = rngXPoints Next rngXPoints MsgBox "Number of series in chart: " & Chart1.SeriesCollection.Count End Sub