(Solved) – Failing to adress Marker only in scatterplot via VBA

  • by

Im trying to set up a macro for a scatterplot which you switch the position of a dataset in the legend and also format the markers. However i fail the entire time for the latter.

This is my macro:

Sub FormatLegend

Dim ChtObj As ChartObject
Set ChtObj = Worksheets("Plot_1").ChartObjects("Diagramm 1")

With ChtObj

    With .Chart.SeriesCollection(1)
         .PlotOrder = 3
    End With

        With .Chart.SeriesCollection(4)
            .Format.Fill.Visible = msoTrue
            .Format.Line.Visible = msoFalse
            .Format.Fill.BackColor.RGB = RGB(146, 208, 80)
            .MarkerSize = 4
            .MarkerStyle = 2
            .Weight = 0.75
    End With
End Sub

I don’t understand how to differentiate between line & marker. When i set .Format.Line.Visible = msoFalse the entire line disappears although I want the marker to remain visible. So my question is how to make the line invisible, but not the marker. furthermore i want to set the width of the marker to 0.75 and do not apply a filling.

appreciate your help.

thanks in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *