我希望图表中的绘图线根据用户指定的特定标准是实心、圆点或方点。我可以使用宏成功设置绘图的线条颜色和标记样式,但我似乎找不到保存绘图线条样式属性值的对象。我曾尝试使用录制宏功能,但更改属性窗口中的线条样式不会显示在代码中,并且运行录制的宏没有效果。
任何帮助是极大的赞赏!
YourChartSeries.Border.LineStyle = [some value from the XlLineStyle enumeration]
Run Code Online (Sandbox Code Playgroud)
更新:在 XL 2010 中录制我得到了这个 -
ActiveChart.SeriesCollection(1).Select
With Selection.Format.Line
.Visible = msoTrue
.DashStyle = msoLineSysDot
End With
ActiveChart.SeriesCollection(2).Select
With Selection.Format.Line
.Visible = msoTrue
.DashStyle = msoLineSysDash
End With
Run Code Online (Sandbox Code Playgroud)
这可能是你正在寻找的。