Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
I have a line chart with 11 series. I want to add a data label to the last point only for each of the series, showing the value and series name with the legend key. I would like to have code that will cycle through each of these series and add that information (note, this is probably simple, but I am a beginner with VBA) Here is some code that I recorded, that works for one of the series (Series 6): Sub Macro3() x = Sheets("Data").Cells(1, 1).Value Sheets("Chart").Select ActiveChart.SeriesCollection(6).Points(x).ApplyDat aLabels ActiveChart.SeriesCollection(6).Points(x).DataLabe l.Select Selection.ShowSeriesName = -1 Selection.ShowLegendKey = -1 ActiveChart.ChartArea.Select End Sub Note: I made the "point" a variable because the chart data is dynamic. This code refers to a cell (Sheet "Data" cell A1) that counts the number of rows of data (will expand and contract depending on dates I choose). That way, I am always getting just the last point. This seems to work fine, I just need code to cycle through all of the series and add the same label. Many thanks for your help Steve |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to change position of chart labels on line chart | Charts and Charting in Excel | |||
labels in line chart | Charts and Charting in Excel | |||
Min, Max Value Labels in Line Chart | Charts and Charting in Excel | |||
Sub-Categories for X-axis labels, line on bar chart? | Charts and Charting in Excel | |||
Can I link timeline labels to a line chart? | Charts and Charting in Excel |