Change text in textbox in chart in Excel 2007

  • Thread starter Thread starter Stratuser
  • Start date Start date
S

Stratuser

After I changed from Excell 2003 to Excel 2007, the following VBA code, which
changed the date in a textbox in a chart, no longer worked:

Sheets("All Styles").Select
ActiveChart.Shapes("Text Box 1026").Select
Selection.Characters.Text = Range("Date").Value

The macro recorder doesn't record anything when I try to use it to get some
code. Any ideas for fixing this?
 
Excel 2007 Shape Text
Sub Textbox()
Dim d As Date
With Sheets("Summary")
d = .Range("DDate")
With .ChartObjects(1).Chart.Shapes(1).TextEffect
.FontSize = 12
.FontBold = True
.Text = d
End With
End With
End Sub
 
Back
Top