Bonjour,
Mon problème est simple je suis parti d'un tutoriel pour adapter la couleur des series en fonction de leurs noms :
J'en ai conclu ce code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
38
39
40
41
42
43 Sub CouleurSeries() Dim MesSeries As Series With ActiveChart For Each MesSeries In .SeriesCollection Select Case MesSeries.Name Case "astuces" MesSeries.Border.ColorIndex = 9 MesSeries.Border.Weight = xlThick MesSeries.MarkerStyle = xlMarkerStyleSquare MesSeries.MarkerBackgroundColorIndex = 9 MesSeries.MarkerForegroundColorIndex = 9 MesSeries.MarkerSize = 10 Case "blog" MesSeries.Border.ColorIndex = 33 MesSeries.Border.Weight = xlThick MesSeries.MarkerStyle = xlMarkerStyleSquare MesSeries.MarkerBackgroundColorIndex = 33 MesSeries.MarkerForegroundColorIndex = 33 MesSeries.MarkerSize = 10 Case "autres" MesSeries.Border.ColorIndex = 16 MesSeries.Border.Weight = xlThick MesSeries.MarkerStyle = xlMarkerStyleSquare MesSeries.MarkerBackgroundColorIndex = 16 MesSeries.MarkerForegroundColorIndex = 16 MesSeries.MarkerSize = 10 Case "global" MesSeries.Border.ColorIndex = 46 MesSeries.Border.Weight = xlThick MesSeries.MarkerStyle = xlMarkerStyleSquare MesSeries.MarkerBackgroundColorIndex = 46 MesSeries.MarkerForegroundColorIndex = 46 MesSeries.MarkerSize = 10 End Select Next End With End Sub
Cependant je me suis rendu compte que MesPoints.Name ne correspond pas aux noms de mes abscisses "Abscisse1", "Abscisse2" etc
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Sub CouleurPoints() Dim MesPoints As Point With ActiveChart.SeriesCollection(1) For Each MesPoints In .Points Select Case MesPoints.Name Case "Abscisse1" With MesPoints.Format.Fill .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorAccent1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0.400000006 .Transparency = 0 .Solid End With Case "Abscisse2" MesPoints.Format.Fill.ForeColor.RGB = RGB(0, 200, 0) End Select Next End With End Sub
En effet MesPoints.Name me renvoie les valeurs suivante : S1P1, S1P2 etc
Je ne vois pas qu'elle est l'objet qui me donnerait ces noms.
Pourriez-vous m'aider, svp ?
Cdt
Partager