WernerGg
New Member
- Joined
- Oct 19, 2010
- Messages
- 43
Chart data Series can have DataLabels at all or some Points. Unfortunately no data Range as for X- and Y-Values can be associated to the labels as a whole. But at least one can manually enter a formula like "='MySheet'!$D$17" into a label and such have labels with arbitrary dynamic text.
The Excel DataLabel class does not support this formulas. It has no methods or properties for that. No idea why the <ACRONYM title=Microsoft>MS</ACRONYM> programmers just forgot that and do not repair that since years. Instead the class has two properties .Caption and .Text which provide the value (but not the formula) of the label text.
I know about an old trick using
but this does no longer work in Excel 2007.
What is missing is a DataLabel.Formula property or methods so that on can write
In Excel 2010 this seems to exist but not in earlier versions.
Does anybody know how to get and set the formula of a data label? Does anybody have an undocumented trick or a DLL for that?
.
The Excel DataLabel class does not support this formulas. It has no methods or properties for that. No idea why the <ACRONYM title=Microsoft>MS</ACRONYM> programmers just forgot that and do not repair that since years. Instead the class has two properties .Caption and .Text which provide the value (but not the formula) of the label text.
I know about an old trick using
Code:
strFormula = ExecuteExcel4Macro("GET.FORMULA(SELECTION())")
What is missing is a DataLabel.Formula property or methods so that on can write
Code:
With aDataLabel
oldFormula = .Formula
newFormula = NowIModifyThat(oldFormula)
.Formula = newFormula
End With
In Excel 2010 this seems to exist but not in earlier versions.
Does anybody know how to get and set the formula of a data label? Does anybody have an undocumented trick or a DLL for that?
.