ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Retrieving linked label formula with VBA (https://www.excelbanter.com/charts-charting-excel/187270-retrieving-linked-label-formula-vba.html)

Holger Gerths

Retrieving linked label formula with VBA
 
Dear group,

I linked datalabels of a chart with cells (by selecting a single label,
typing "=", clicking the cell to link with and then enter).
Now I want to get the label's formula with VBA, but I only get the value
with objPoint.DataLabel.Text.
I am missing something like objPoint.DataLabel.Formula.
Currently I use XL 2003.
Any good ideas?

Thanks in advance, Holger.



Héctor Miguel

Retrieving linked label formula with VBA
 
hi, Holger !

I linked datalabels of a chart with cells (by selecting a single label
typing "=", clicking the cell to link with and then enter).
Now I want to get the label's formula with VBA
but I only get the value with objPoint.DataLabel.Text.
I am missing something like objPoint.DataLabel.Formula.
Currently I use XL 2003.
Any good ideas?


you need to activate(select) "the chart" AND activate(select) "the datalabel"
and then... "ask" for help to the (ancient) xl-4 macro-functions (i.e.)

msgbox executeexcel4macro("get.formula(selection())")

which gives the formula in the form: =[bookname]sheetname!R1C1

or... you can "convert" into A1 notation i.e.

msgbox application.convertformula(executeexcel4macro("get .formula(selection())"),xlr1c1,xla1)

hth,
hector.




All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com