Change point color in Excel VBA graphics

I have this chart in which if any point in the graph exceeds a certain limit, then its color should change.

enter image description here


can someone suggest me how to get the diagram in VBA and then apply this condition, for example, I want to change the color of the highest point in the above graph. Any help would be greatly appreciated.

+5
source share
2 answers

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

The color of each dot .Points(PointNumber).Interior.Color

The number of points you must complete is equal to .Points.Count

The value of each point is equal to .Points(PointNumber).Value

colors of the markers themselves (applies only to linear, differential and radar diagrams):

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

Take another approach that does not require any code.

, A ( ) B, A2 B2, A1 B1. , B. , , .

C1 "Deviant".

C2 , , - :

= ( (2 > UPPERLIMIT, 2

C, B , # N/A C, # N/A .

C, Special . , , , .

+4

All Articles