Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Printing dynamic labels | Excel Discussion (Misc queries) | |||
Data Labels, Error Bars, and Dynamic Charting | Charts and Charting in Excel | |||
Dynamic legend labels | Charts and Charting in Excel | |||
Dynamic Labels | Excel Worksheet Functions | |||
Dynamic chart labels | Charts and Charting in Excel |