Chers Tous,
J'ai pu finalement résoudre mon problème avec la formule VBA suivante :
Public Sub MAJ()
Dim a As ChartObject
MAJGraph "Graphique 1", 4
End Sub
Private Sub MAJGraph(psNomGraph As String, piLigDeb As Integer)
Dim iLig As Integer
Dim bFin As Boolean
Dim iPoint As Integer
Application.ScreenUpdating = False
ActiveSheet.ChartObjects(psNomGraph).Activate
iPoint = 1
iLig = piLigDeb
bFin = False
'parcours du tableau (colonne C), à partir de la ligne indiquée en paramètre
While Not bFin
If Range("C" & iLig).Value = "" Then
bFin = True
Else
'affecte la couleur
With ActiveChart.SeriesCollection(1).Points(iPoint).Format.Fill
.Visible = msoTrue
.ForeColor.RGB = Range("C" & iLig).DisplayFormat.Interior.Color
End With
iPoint = iPoint + 1
iLig = iLig + 1
End If
Wend
Application.ScreenUpdating = True
End Sub
Voici le résultat que je recherchais:
On peut ainsi manipuler à souhait le graphique pour l'adapter à tous les scenarii.
Merci à h2so4 qui a apporté sa contribution.
Cordialement,
SCSK