Jumat, 16 Juni 2017

[ExcelVBA] Bubblegraph series of different colours - solution

 

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)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

----------------------------------
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