更改图表中的点颜色excel VBA [英] Change the Point Color in chart excel VBA

查看:2012
本文介绍了更改图表中的点颜色excel VBA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个图表,如果图表中的任何一点超过特定限制,它的颜色应该会改变。


I have this chart in which if any point in graphs exceeds specific limit then its color should change.


任何人建议我如何获得图表在VBA,然后应用这种条件,例如,我想改变上面的图表中的最高点的颜色。任何帮助将非常感激。

can anyone suggest me how to get the chart in VBA and then apply this kind of condition e.g i want to change the color of highest point in the above graph . Any help would be highly appreciated.

推荐答案

使用: ActiveWorkbook.Sheets(Sheet1)。ChartObjects (Chart1)。Chart.SeriesCollection(1)

每个点的颜色为 .Points .Interior.Color

你必须循环的点数是 .Points.Count

每个点的值为 .Points(PointNumber).Value

标记本身的颜色(仅适用于线形,散射和雷达图表):

colors of the markers themselves (Applies only to line, scatter, and radar charts):

.Points(PointNumber).MarkerBackgroundColor = RGB(0,255,0)    ' green
.Points(PointNumber).MarkerForegroundColor = RGB(255,0,0)    ' red
.Points(PointNumber).MarkerStyle = xlMarkerStyleCircle ' change the shape

这篇关于更改图表中的点颜色excel VBA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆