As per the attached workbook I have a bubble chart on sheet 'Prioritisation' which is taking its series data points from the sheet 'Master Copy'. I also have a macro which is designed to update the bubble colours based on the cell colour of column AJ on the 'Master Copy' worksheet.
The macro is:
Option Explicit
Sub ColorChartSeries()
Dim iRow As Long, iCol As Long
Dim theBubbles As Range
Dim theChart As Chart
Dim theSeries As Series
Dim thePoint As Point
Set theChart = ActiveChart
If (theChart.ChartType <> xlBubble And theChart.ChartType <> xlBubble3DEffect) Then
MsgBox "This works only for bubble charts!"
End
End If
For Each theSeries In theChart.SeriesCollection
Set theBubbles = Range(theSeries.BubbleSizes)
iRow = 1
For Each thePoint In theSeries.Points
thePoint.Format.Fill.ForeColor.RGB = Intersect(Worksheets("Master Copy").Range("AJ:AJ"), theBubbles.Rows(iRow).EntireRow).DisplayFormat.Interior.Color
iRow = iRow + 1
Next thePoint
Next theSeries
End Sub
As you will see the bubble colours do not reflect the cell and also do not update if I use the slicers associated to the 'Master Copy' worksheet
Bookmarks