1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| Private Sub Chart_Activate()
Set Wb1 = Workbooks("Book1.xlsb")
Set Ws2 = Wb1.Worksheets("Sheet 1")
Application.ScreenUpdating = False
Set Ch = Worksheets("Charts").ChartObjects("Participation").Chart
With Ch
With .SeriesCollection(1)
For i = 1 To .Points.Count
If .SeriesCollection(1).Value >= 2 Then
.Points(i).ForeColor.RGB = RGB(0, 176, 80)
ElseIf .SeriesCollection(1).Value = 1 Then
.Points(i).ForeColor.RGB = RGB(255, 153, 51)
ElseIf .SeriesCollection(1).Value = 0 Then
.SetElement (msoElementDataLabelCenter)
With Selection.Format.TextFrame2.TextRange.Font.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Transparency = 0
.Solid
End With
Selection.Format.TextFrame2.TextRange.Font.Italic = msoTrue
End If
Next i
End With
With .FullSeriesCollection(2).Select
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 112, 192)
.Transparency = 0
End With
End With
End With
End Sub |
Partager