LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Dynamic Data Labels

Hi

You can apply data labels to all series of all charts on the active sheet in
the following way:

Dim co As ChartObject
Dim ser As Series
For Each co In ActiveSheet.ChartObjects
For Each ser In co.Chart.SeriesCollection
ser.ApplyDataLabels xlDataLabelsShowLabel
Next ser
Next co

If you have defined your chart series correctly, the labels will be correct!

Hope that works!

"NicB." wrote:


All right,

I am building a scatter plot chart that I want be very interactive. I
have coded the workbook such that it allows the user to select which
data set(s) to view and to turn data labels on and off. In addition to
this, each series will have a name, but I want each specific data point
to have its own name that will change based upon values listed in
worksheet cells.

I have been able to accomplish all of the above, but now I want an easy
way to repeat this for all data sets and all data points. I am thinking
of a loop statement or a "for every x" type statement, but am not very
familiar with these. For example I need something like the first few
lines of the code below...

Sub Data_Labels()

'This doesn't work

Dim SeriesCollections As X
Dim Points As Y
For Every X and Y

'This does work

ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.SeriesCollection(1).Points(3).Select
With Selection
.HasDataLabel = True
.DataLabel.Text = Range("N20")
End With

End Sub

Thoughts?

Thank you,

NicB.


--
NicB.
------------------------------------------------------------------------
NicB.'s Profile: http://www.excelforum.com/member.php...o&userid=20639
View this thread: http://www.excelforum.com/showthread...hreadid=530997


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing dynamic labels donpro Excel Discussion (Misc queries) 0 February 11th 10 08:31 PM
Data Labels, Error Bars, and Dynamic Charting Rcarper Charts and Charting in Excel 1 August 28th 09 04:24 AM
Dynamic legend labels Steve-in-austin Charts and Charting in Excel 2 March 5th 07 03:31 PM
Dynamic Labels coa01gsb Excel Worksheet Functions 4 March 2nd 06 03:29 PM
Dynamic chart labels dano Charts and Charting in Excel 1 June 23rd 05 12:21 AM


All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"