Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Kaua Costa   on Nov 12 In MS Office Category.

  
Question Answered By: Eustatius Bakker   on Nov 12

I don't know what is causing this odd behavior. The problem  only seems to occur
when the series  name is reassigned and the new name begins with a zero. I can
suggest a workaround, however. Try the following revised version of your code:

Sub AAAA()
Dim d1 As String
Sheets("Chart1").Select
MsgBox ("Name is ") & ActiveChart.SeriesCollection(1).Name
d1$ = "01-Feb-06"
ActiveChart.SeriesCollection(1).Name = " " & d1$
MsgBox "New name 1 = " & ActiveChart.SeriesCollection(1).Name
ActiveChart.SeriesCollection(1).Name = Format(Worksheets(1).Cells(1, 6), "
dd-mmm-yy")
MsgBox "New name 2 = " & ActiveChart.SeriesCollection(1).Name
End Sub

Basically, I am appending a space before the date  string, in both the direct
assignment statement and in the Format string (" dd-mmmm-yy"). The space doesn't
show in the result (because of the glitch), but the leading zero does.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Chart Series Or get search suggestion and latest updates.


Tagged: