Hi folks,
The is a piece of code recorded directly from Excel in creating a bubble chart with 17 points. Using the chart dialogue box ('Source data') works fine i.e. 17 points added. However, running this code by itself results in a chart with only 1 point! Even wierder, going back into the source data... dialogue box, all the references for the new series are correct, pointing to 17 rows of data.
Any ideas why it's doing this, or workarounds would be most welcome!
Thanks.
The is a piece of code recorded directly from Excel in creating a bubble chart with 17 points. Using the chart dialogue box ('Source data') works fine i.e. 17 points added. However, running this code by itself results in a chart with only 1 point! Even wierder, going back into the source data... dialogue box, all the references for the new series are correct, pointing to 17 rows of data.
Any ideas why it's doing this, or workarounds would be most welcome!
Thanks.
Code:
Sub Macro1()
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R2C2:R18C2"
ActiveChart.SeriesCollection(1).Values = "=Sheet1!R2C3:R18C3"
ActiveChart.SeriesCollection(1).Name = "=Sheet1!R1C1"
ActiveChart.SeriesCollection(1).BubbleSizes = "=Sheet1!R2C4:R18C4"
ActiveChart.ChartType = xlBubble3DEffect
End Sub