Re : droite horizontale graphique dynamique
Sub add_graph1()
Dim ch As ChartObject
voila le bout du programme qui créer le tableau et donc une fois réalisé je n'ai plus acces aux données source(car il est construit a partir d'un tableau dynamique). j'aimerai connaitre la facon de tracer une droite horizontale dessus(dont la valeur est fixe!!!) en vb
'creer le graphique
Set ch = Worksheets("Bord1").ChartObjects.Add(10, 76, 400, 250)
ch.Chart.ChartWizard Source:=Worksheets("Tableau").Range("A10:B12"), gallery:=xlLine
ch.Chart.ChartType = xlColumnClustered 'type de graphique
nom1 = ch.Name
'mise en forme du graphique
ch.Chart.ChartArea.Border.ColorIndex = 57
ch.Chart.ChartArea.Border.Weight = 3
ch.Chart.ChartArea.Border.LineStyle = 1
ch.Chart.ChartArea.Interior.ColorIndex = 2
ch.Chart.ChartArea.Interior.PatternColorIndex = 1
ch.Chart.ChartArea.Interior.Pattern = 1
ch.Chart.PlotArea.Interior.ColorIndex = 2
'enlever les champs
ch.Chart.HasPivotFields = False
ch.Chart.HasTitle = True
'titre
With ch.Chart.ChartTitle
.Text = "Quantité de pièces produites en fonction de la semaine"
.Border.LineStyle = xlThin
.Shadow = True
End With
Sheets("Bord1").Select
End Sub