Re : Besoin d'aide svp !!!
Bonjour,
J'ai simplifié l'approche :
1. un seul bouton "Affichage pour le graphique"
2. On choisi le N° à afficher
3. on affiche
J'ai ajouter dans updateChart la récupération de la cellule active et la modification du titre
Avec ce petit coup de pouce cela devrait rouler!
GIBI
La nouvelle fonction
Private Sub UpdateChart(chtype)
Dim CurrentChart As Chart
Dim Fname As String
Sheets("graph").Cells(3, 1) = ActiveCell.Value 'récupérer la value de la cellule active
Sheets("graph").ChartObjects(1).Activate
ActiveChart.ChartTitle.Select
Selection.Characters.Text = "rouleaux " & Sheets("graph").Cells(3, 1) ' modif titre
Selection.AutoScaleFont = False
With Selection.Characters(Start:=1, Length:=12).Font
.Name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Set CurrentChart = Sheets("graph").ChartObjects(1).Chart
CurrentChart.ChartType = chtype
' Enregistre le graphique au format GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
CurrentChart.Export FileName:=Fname, FilterName:="GIF"
' Affiche le graphique
Image1.Picture = LoadPicture(Fname)
End Sub