Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / December 2004

Tip: Looking for answers? Try searching our database.

Data Label Value in Formula?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Hageman - 30 Dec 2004 14:09 GMT
Is it possible to use a data label value in a formula?  How would this be done?

Thanks, Phil
Frank Kabel - 30 Dec 2004 16:54 GMT
Hi
it is. But maybe give some more details what you're trying to achieve
exactly

Signature

Regards
Frank Kabel
Frankfurt, Germany

> Is it possible to use a data label value in a formula?  How would this be
> done?
>
> Thanks, Phil
John Mansfield - 30 Dec 2004 17:07 GMT
Phil,

I may not be understanding your question but would a macro like the example
below do?  It extracts the text in the first series data label to an variable
of the integer type and then references that variable in a formula in cell
A1.  In this example, the formula would look like "= 6 + your label value +
4".  Click on your chart to activate it and then run the macro.  If it works
for you, it would need to be modified to your specs:

Sub DataLabelTextToFormula()
   Dim Cht As Chart
   Dim Val As Integer
   Set Cht = ActiveChart
   Cht.SeriesCollection(1).ApplyDataLabels Type:=xlDataLabelsShowValue
   Val = Cht.SeriesCollection(1).Points(1).DataLabel.Text
   Worksheets("Sheet1").Range("A1").Formula = "=6+" & Val & "+4"
End Sub

Other than that, you can always direct reference the data source in your
formula as it is the same source for the data label.

----
Regards,
John Mansfield
http://www.pdbook.com

> Is it possible to use a data label value in a formula?  How would this be done?
>
> Thanks, Phil
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.