作者:juxiu小妹_895 | 来源:互联网 | 2023-06-09 13:10
Iamtryingtohavethepointsinachartchangecoloriftheyarewithincertainvalueparamaters(
I am trying to have the points in a chart change color if they are within certain value paramaters (i.e., >1 is green, <1 is red, anything else is blue). I cannot determine how to get VBA to give me the value of any given point.
如果它们在某些值参数范围内(即> 1为绿色,<1为红色,其他任何为蓝色),我试图让图表中的点改变颜色。我无法确定如何让VBA给我任何给定点的价值。
In this thread, previously answered, the answer (very helpful in other ways) indicates that points(num).value will return the value at the point. However, I am getting an error message doing this, and nowhere else online or in the VBA help can I find a method that corresponds to this. Has anyone else had any success with this?
在此线程中,先前已回答,答案(在其他方面非常有用)表示点(num).value将返回该点的值。但是,我收到一条错误消息,并且在其他任何地方在线或在VBA帮助中我都可以找到与此对应的方法。有没有人有这个成功?
Here's the snippet of code giving me trouble:
这是代码片段给我带来的麻烦:
For Count = 1 To 7
If Worksheets("Sheet1").ChartObjects("ChartName").Chart.SeriesCollection(1).Points(Count).Value > 1 Then
'... do stuff
Because of the way the data are stored in the dataset, it would definitely be better to get the value from the chart directly. I could figure out a workaround using the dataset itself, but I would rather avoid that.
由于数据存储在数据集中的方式,从图表中直接获取值肯定会更好。我可以使用数据集本身找出解决方法,但我宁愿避免这种情况。
1 个解决方案