Excel VBA 标记样式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26099917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 04:41:57  来源:igfitidea点击:

Excel VBA MarkerStyle

excelvbaexcel-vba

提问by Advice Me

I am trying to change series marker style into crosses X.

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

I have created test script in new excel file with:

我在新的 excel 文件中创建了测试脚本:

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

and it works fine. I have:

它工作正常。我有:

    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

Does anyone have an idea?

有没有人有想法?

Actually, it is cross, but it is not displayed as a cross:

其实是十字,只是不显示为十字:

enter image description here

在此处输入图片说明

So I believe it has some problems with Marker Fill or Marker Line Color... I am still confused.

所以我相信它在标记填充或标记线颜色方面存在一些问题......我仍然感到困惑。

回答by ZAT

Assume this will serve the purpose:

假设这将达到以下目的:

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

回答by Mr. Mascaro

It looks like your marker fill color is the same as the marker foreground color. You'll need to change it.

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