Excel/VBA creer un bouton ds graph par macro
Résolu
trucfud
-
sofia -
sofia -
Bonjour,
j'ai une macro qui me cree un graphique, et je voudrai qu'elle y place un bouton auquel j'associe ma macro "backToMenu"
Ma macro marche impec' pour ce qui est du graphique, mais le bouton n'apparait pas dans mon graphique.
Si vous avez des idees, je suis tout ouie.
Merci par avance
ci dessous, mon code:
ActiveChart.Shapes.AddTextbox(msoTextOrientationHorizontal, 576.04, 28.25, _
131.44, 31.79).Select
ActiveSheet.Buttons.Add(5487171.75, 269149.5, 1251642, 302925.75).Select
Selection.Characters.Text = ""
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
'changer nom du bouton
Selection.OnAction = "BackToMenu_Click"
ActiveChart.Shapes("Button 7").Select
Selection.Characters.Text = "back to menu"
Selection.AutoScaleFont = False
With Selection.Characters(Start:=1, Length:=12).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveChart.ChartArea.Select
End Sub
j'ai une macro qui me cree un graphique, et je voudrai qu'elle y place un bouton auquel j'associe ma macro "backToMenu"
Ma macro marche impec' pour ce qui est du graphique, mais le bouton n'apparait pas dans mon graphique.
Si vous avez des idees, je suis tout ouie.
Merci par avance
ci dessous, mon code:
ActiveChart.Shapes.AddTextbox(msoTextOrientationHorizontal, 576.04, 28.25, _
131.44, 31.79).Select
ActiveSheet.Buttons.Add(5487171.75, 269149.5, 1251642, 302925.75).Select
Selection.Characters.Text = ""
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
'changer nom du bouton
Selection.OnAction = "BackToMenu_Click"
ActiveChart.Shapes("Button 7").Select
Selection.Characters.Text = "back to menu"
Selection.AutoScaleFont = False
With Selection.Characters(Start:=1, Length:=12).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveChart.ChartArea.Select
End Sub
A voir également:
- Excel/VBA creer un bouton ds graph par macro
- Créer un compte google - Guide
- Comment créer un groupe whatsapp - Guide
- Telecharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Créer liste déroulante excel - Guide
- Créer un lien pour partager des photos - Guide