Faudrait que tu sois plus précis :
a) Où sont tes données ? Dans excel, dans un fichier à part
b) Où doit se trouver le bouton qui génère le graphe ? Dans excel, ailleur ?
c) Où doit apparaître le graphe
L'activation d'un graphe peut tjrs se faire en code, et excel peut-être activé par d'autres programmes.
Sub GrapheAvisUAP()
Dim titre As String
titre = "Permis d'urbanisme sur avis préalable du F.D."
Worksheets("StatUAP").Activate
Range("B1:B7,D1:D7").Select
Range("D1").Activate
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets("StatUAP").Range("B1:B7,D1:D7"), _
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Luxembourg - " + titre
End With
ActiveChart.HasLegend = False
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowLabelAndPercent, LegendKey _
:=False, HasLeaderLines:=True
AdapteGraphique