Excel VBA MarkerStyle

我正在尝试将系列标记样式更改为十字X.

我已经在新的Excel文件中创build了testing脚本:

ActiveChart.SeriesCollection(1).Select Selection.MarkerStyle = xlMarkerStyleX 

它工作正常。 我有:

  Worksheets("RecordID Chart").ChartObjects(1).Activate ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection(graph + 2).Name = lo.ListColumns("RecordID").DataBodyRange.Rows(1) ActiveChart.SeriesCollection(graph + 2).XValues = tesPercentage ActiveChart.SeriesCollection(graph + 2).Values = testError ActiveChart.SeriesCollection(graph + 2).MarkerStyle = xlMarkerStyleX ActiveChart.SeriesCollection(graph + 2).MarkerSize = 5 ActiveChart.SeriesCollection(graph + 2).Format.Line.ForeColor.RGB = myCol & graph ActiveChart.SeriesCollection(graph + 2).Select Selection.Format.Line.Visible = msoFalse 

有没有人有一个想法?

实际上,它是交叉的,但不是以十字形显示:

在这里输入图像说明

所以我认为Marker Fill或Marker Line Color有一些问题…我仍然感到困惑。

假设这将达到目的:

 ActiveChart.SeriesCollection(1).Select With Selection .MarkerStyle = xlMarkerStyleX .MarkerSize = 7 .MarkerBackgroundColorIndex = xlColorIndexNone .MarkerForegroundColorIndex = xlColorIndexAutomatic End With 

看起来您的标记填充颜色与标记前景颜色相同。 你需要改变它。