Hello,
I have a single data series in a simple x-y chart and I recorded some VBA code to format the data series line, its marker fill and marker border. What I've found is that when I just change the marker border (and record those actions via the Macro Recorder), what gets recorded actually works on both the marker and the data series line.
So, I want to have the line connecting the data points to be invisible, but I want the marker border to be visible and make it a specific color. When I execute the code, it makes both the marker and the line the same color. If I end my code with a command to just make the line invisible, it makes both the line and the marker border invisible as well.
Here's a snippet of the macro that got recorded:
ActiveChart.FullSeriesCollection(1).Select
Application.CommandBars("Format Object").Visible = False
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 112, 192)
End With
This is a particularly vexing issue and I suspect that the proper way to make these changes is to NOT use the macro recorder, but rather use whatever Excel VBA commands were designed to specifically work on the markers themselves. However, I am not familiar with the particular commands that do just that.
Does anyone have any suggestions?
Thanks,
Scotty81
I have a single data series in a simple x-y chart and I recorded some VBA code to format the data series line, its marker fill and marker border. What I've found is that when I just change the marker border (and record those actions via the Macro Recorder), what gets recorded actually works on both the marker and the data series line.
So, I want to have the line connecting the data points to be invisible, but I want the marker border to be visible and make it a specific color. When I execute the code, it makes both the marker and the line the same color. If I end my code with a command to just make the line invisible, it makes both the line and the marker border invisible as well.
Here's a snippet of the macro that got recorded:
ActiveChart.FullSeriesCollection(1).Select
Application.CommandBars("Format Object").Visible = False
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 112, 192)
End With
This is a particularly vexing issue and I suspect that the proper way to make these changes is to NOT use the macro recorder, but rather use whatever Excel VBA commands were designed to specifically work on the markers themselves. However, I am not familiar with the particular commands that do just that.
Does anyone have any suggestions?
Thanks,
Scotty81