Hi all,

Great forum

I have a complicated scatter chart where I want to :

1. use a macro to add labels to the points (achieved)

2. Use a macro to change the marker depending upon the X value. So at the moment, I know how to change the marker color using the code below. Is there any way to modify this so that it selects an image file for the marker? Then I could use my own custom markers via the same macro.


Sub x()

Dim objCht As ChartObject
Dim rngData As Range
Dim lngIndex As Long
Dim lngColor As Long

Set rngData = Range("U178:U196")
Set objCht = ActiveSheet.ChartObjects(3)
With objCht.Chart
With .SeriesCollection(1)
For lngIndex = 1 To .Points.Count
Select Case rngData.Cells(lngIndex, 1).Value
Case Is = "1"
lngColor = RGB(0, 0, 255)
Case Is = "2"
lngColor = RGB(0, 255, 0)
Case Else
lngColor = RGB(255, 0, 0)
End Select
With .Points(lngIndex).Format.Fill
.ForeColor.RGB = lngColor
.BackColor.RGB = lngColor
End With
Next
End With
End With
End Sub



Any thoughts appreciated