从 VBA 的散点图中删除标记
Remove the marker from scatterplot chart in VBA
我想从 VBA 中的散点图中删除标记,但我不知道该怎么做。我已经在谷歌上搜索了一段时间,也使用了宏记录器,但是 none 的建议似乎有效(代码中也包含了我的试用解决方案)。
Sub RekFiguur()
Mod_berekening.clearShape "UGT - moment", "B7:T19"
Dim wb As Workbook: Set wb = ThisWorkbook
Dim sht As Worksheet: Set sht = wb.Sheets("UGT - moment")
Dim sh As Shape
Dim chartObj As ChartObject
Dim chartSheet As Chart
Dim activeRow As Integer
Set chartObj = sht.ChartObjects.Add(Top:=80, Left:=20, Width:=240, Height:=150)
With chartObj.Chart
.ChartType = xlXYScatterLines
.HasLegend = False
.Parent.Name = "UGT-rek"
'Draw strain for concrete
.SeriesCollection.NewSeries
With .SeriesCollection(1)
.Name = "UGT-beton-rek"
.xValues = sht.Range("$AA:$AA")
.Values = sht.Range("$AE:$AE")
'.MarkerStyle = xlMarkerStyleNone 'No response
'.MarkerStyle = -4142 'No response
'.Format.Fill.Visible = msoFalse 'Removes only fill
'.Format.Line.Visible = msoFalse 'Does remove the marker but cant edit line anymore
.Format.Line.Weight = 1
.Format.Line.DashStyle = msoLineSolid
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
End With
.HasTitle = True
.HasTitle = False
'Some more irrelevant code for the chart I left out
end with
结果见下方,遗憾的是带有标记。奇怪的是,直线是用代码的精确副本制作的,但只有两个数据点,而且那些标记被很好地删除了,我对此一无所知..
提前致谢。请客气一点,如果您需要更多信息,我会很乐意澄清
见上面的代码。我也尝试了 的解决方案,但这对我也没有帮助
改变
.ChartType = xlXYScatterLines
至
.ChartType = xlXYScatterLinesNoMarkers
我想从 VBA 中的散点图中删除标记,但我不知道该怎么做。我已经在谷歌上搜索了一段时间,也使用了宏记录器,但是 none 的建议似乎有效(代码中也包含了我的试用解决方案)。
Sub RekFiguur()
Mod_berekening.clearShape "UGT - moment", "B7:T19"
Dim wb As Workbook: Set wb = ThisWorkbook
Dim sht As Worksheet: Set sht = wb.Sheets("UGT - moment")
Dim sh As Shape
Dim chartObj As ChartObject
Dim chartSheet As Chart
Dim activeRow As Integer
Set chartObj = sht.ChartObjects.Add(Top:=80, Left:=20, Width:=240, Height:=150)
With chartObj.Chart
.ChartType = xlXYScatterLines
.HasLegend = False
.Parent.Name = "UGT-rek"
'Draw strain for concrete
.SeriesCollection.NewSeries
With .SeriesCollection(1)
.Name = "UGT-beton-rek"
.xValues = sht.Range("$AA:$AA")
.Values = sht.Range("$AE:$AE")
'.MarkerStyle = xlMarkerStyleNone 'No response
'.MarkerStyle = -4142 'No response
'.Format.Fill.Visible = msoFalse 'Removes only fill
'.Format.Line.Visible = msoFalse 'Does remove the marker but cant edit line anymore
.Format.Line.Weight = 1
.Format.Line.DashStyle = msoLineSolid
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
End With
.HasTitle = True
.HasTitle = False
'Some more irrelevant code for the chart I left out
end with
结果见下方,遗憾的是带有标记。奇怪的是,直线是用代码的精确副本制作的,但只有两个数据点,而且那些标记被很好地删除了,我对此一无所知..
提前致谢。请客气一点,如果您需要更多信息,我会很乐意澄清
见上面的代码。我也尝试了 的解决方案,但这对我也没有帮助
改变
.ChartType = xlXYScatterLines
至
.ChartType = xlXYScatterLinesNoMarkers