'Issue with MS Excel macro adding colour to a bubbles in a bubble chart
I am using Microsoft 365 Apps for enterprise Excel and am following this tutorial: https://www.youtube.com/watch?v=nEOjcyGh1O0 to colour the bubbles in my bubble chart. The row "Ser.Points(i).Format.Fill.ForColor.RGB = RGB(255, 0, 0)" is throwing the error "Run-time error '438': Object doesn't support this property or method". How can I resolve this please?
Sub ChangePointColour()
Dim Cht As Chart
Dim Ser As Series
Dim Pt As Point
'Seect the chart
ActiveSheet.ChartObjects(1).Activate
Set Cht = ActiveChart
Set Ser = Cht.SeriesCollection(1)
PointCount = Ser.Points.Count
For i = 1 To PointCount
'Get the colour from column F
ThisColor = ActiveSheet.Cells(i + 1, 6).Value
Select Case ThisColor
Case "Red"
Ser.Points(i).Format.Fill.ForColor.RGB = RGB(255, 0, 0)
Case "Green"
Ser.Points(i).Format.Fill.ForColor.RGB = RGB(0, 255, 0)
Case "Amber"
Ser.Points(i).Format.Fill.ForColor.RGB = RGB(255, 191, 0)
End Select
Next i
End Sub
Solution 1:[1]
ForeColor instead of ForColor.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Spectral Instance |

