Hi all
Had to urgently produce a bubblechart for someone last night, and Excel’s default option is to clump everything together as one range, and the end result is one colour. Entering the series one by one is very tedious, a perfect opportunity for automation.
Programmed the below after a short recording, and it worked like a charm. Each bubble had a different colour.
Regards, Paul V
‘*******************
Sub Macro1()
'
' Macro1 Macro
'
Dim i As Integer
'
For i = 2 To 49
ActiveChart.PlotArea.Select
Application.CutCopyMode = False
With ActiveChart.SeriesCollection.NewSeries
.Name = Range("B" & i)
.XValues = Range("C" & i).Value
.Values = Range("D" & i).Value
.BubbleSizes = Range("E" & i).Value
End With
Next i
End Sub
‘*****************
Posted by: Paul Vermeulen <paul.vermeulen@vulcantech.com.au>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Tidak ada komentar:
Posting Komentar