If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Line chart, value labeling
Just a little tweak to the code is needed.
Sub LastPointLabel() Dim mySrs As Series Dim nPts As Long For Each mySrs In ActiveChart.SeriesCollection With mySrs nPts = .Points.Count mySrs.Points(nPts).ApplyDataLabels _ Type:=xlDataLabelsShowValue, _ AutoText:=True, LegendKey:=False mySrs.Points(nPts).DataLabel.Text = mySrs.Values ' ** End With Next End Sub Cheers Andy NYBoy wrote: Gentlemen, It doesn't give the mathematical value. Instead, it gives me the legand of the line (e.g. Monthly Performace). I am looking for the value of the last point. By the ways, you guys are great help...I learn a lot from here... ********************************************* Line chart, value labeling If you have the workbook with the chart open use ALT+F11 to get to the VBE (Visual Basic Editor/Environment). Use the Insert menu to add a Module. Paste the code from Jon's page. ALT+F11 to return to your workbook. select the chart and the press ALT+F8 to display the Macro dialog. From here run the LastPointLabel Macro. To 'close' the thread just post a reply to say the solution worked. Cheers Andy NYBoy wrote: --- Message posted from http://www.ExcelForum.com/ -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Thread Tools | |
Display Modes | |
|
|