Macro de modification de texte
Bonjour, s'il vous plait je voudrais créer une macro qui permet de modifier le titre d'un graphe automatiquement, j'ai déjà essayé avec un code grâce à l'enregistreur, j'obtiens le code suivant:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| ActiveChart.ChartTitle.Select
ActiveChart.ChartTitle.Text = "Tableau ABCD"
Selection.Format.TextFrame2.TextRange.Characters.Text = _
"Tableau ABCD"
With Selection.Format.TextFrame2.TextRange.Characters(1, 38).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 38).Font
.BaselineOffset = 0
.Bold = msoTrue
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(0, 0, 0)
.Fill.Transparency = 0
.Fill.Solid
.Size = 28
.Italic = msoFalse
.Kerning = 12
.Name = "+mn-lt"
.UnderlineStyle = msoNoUnderline
.Strike = msoNoStrike |
mais ça me donne un bug au niveau de la ligne:
Code:
1 2
| Selection.Format.TextFrame2.TextRange.Characters.Text = _
"Tableau ABCD" |