我见过一些使用Arrow to Indicate Special Points on Excel chart like this的例子。但我想用VBA 来实现这一点。例如,如果图表上的某个点大于 90,那么它会显示与该点对应的箭头。
请建议我应该如何在 VBA 中进行处理。任何帮助,将不胜感激。
更新
除了改变点颜色之外,还有其他好的建议可以使该点更加突出吗?
更新2
现在我正在使用这段代码。
For Each oCell In Range("e4:e" & LastRow) 'loop
If oCell.Value < sd13 Then 'rule 13s
Range("V4").Value = "Rule 13s voilated!"
Range("V4:w4").Interior.Color = RGB(255, 0, 0)
ActiveWorkbook.Sheets("LDL-C").ChartObjects("Chart 1047").Chart.SeriesCollection(1).Points(j).MarkerBackgroundColor = RGB(255, 0, 0)
End If
Next
最佳答案
Apart from just changing the point color is there any other good suggestion to make that point more prominent.
这有帮助吗?
With ActiveChart
For i = 1 To .SeriesCollection.Count
a = .SeriesCollection(i).Values
For l = 1 To .SeriesCollection(i).Points.Count
If mymax < a(l) Then
mymax = a(l)
.SeriesCollection(i).DataLabels.Select
Selection.Format.Line.Visible = msoTrue
Selection.Format.Line.Visible = msoFalse
.SeriesCollection(i).Points(l).DataLabel.Select
.SeriesCollection(i).Points(l).Select
.SeriesCollection(i).DataLabels.Select
.SeriesCollection(i).Points(l).DataLabel.Select
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
End With
With Selection.Format.Line
.Visible = msoTrue
.Weight = 2
End With
End If
Next l
Next
End With
快照
另一张快照
关于vba - 使用 VBA 指示特殊点的箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11339362/