Change the Point Color in chart excel VBA

后端 未结 2 667
情书的邮戳
情书的邮戳 2020-12-03 23:01

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

\"enter

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 23:24

    Using: ActiveWorkbook.Sheets("Sheet1").ChartObjects("Chart1").Chart.SeriesCollection(1)

    Color of each point is .Points(PointNumber).Interior.Color

    The number of points you have to cycle though is .Points.Count

    The value of each point is .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
    

提交回复
热议问题