Hi,
I have a bubble chart that should change the bubble color based on a RGB code in a column. I have 4 criteria, therefore 4 color codes.
My chart is split in 4 frames, and the bubbles will change color based on criteria above.
The macro throws and error but it changes the colors properly with data unfiltered. The problem is that when I filter a column the bubble chart gets updated, but the colors are moving from their frames. I checked the codes and somehow the colors are modified, are not reflected as per my criterias.
Anyone has any idea on how to make it work with filtered data or some other way?
Thanks!
Code:
I have a bubble chart that should change the bubble color based on a RGB code in a column. I have 4 criteria, therefore 4 color codes.
My chart is split in 4 frames, and the bubbles will change color based on criteria above.
The macro throws and error but it changes the colors properly with data unfiltered. The problem is that when I filter a column the bubble chart gets updated, but the colors are moving from their frames. I checked the codes and somehow the colors are modified, are not reflected as per my criterias.
Anyone has any idea on how to make it work with filtered data or some other way?
Thanks!
Code:
VBA Code:
Sub BB()
Dim cht As Chart, ser As Series, r As Range, i%
Sheets("Overview").ChartObjects("Graphique 3").Activate ' your chart name here
Set cht = ActiveChart
Set ser = cht.SeriesCollection(1)
Set r = [I38] ' starting RGB cell
'On Error Resume Next
For i = 1 To ser.Points.Count
ser.Points(i).Format.Fill.ForeColor.RGB = r
Set r = r.Offset(1)
Next
End Sub