Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Show Last Values in  Excel Chart

Posted on 2013-01-14
Medium Priority
Last Modified: 2013-01-16
I would like to show the value of only the last point of all series in a line
 chart in excel.

I can do it manually, (click the point in the graph - data labels - show value).
Is it possible to do it automatically, so when I change the data source, the
chart will still show the value of the last point ?  Also,  I am not very familiar with VBA and attached you will find a sample spreadsheet.

I have used this link below but I was unsuccessful to get it working
Question by:jlloyd7940
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 22

Assisted Solution

Flyster earned 600 total points
ID: 38776687
See formulas in Weekly Graphs worksheet cells H9:H10. It's reading the value from your data source and not the chart, but the values are the same.

LVL 18

Expert Comment

by:Curt Lindstrom
ID: 38776950
Try the attached file. It's based on the macros from

You can see the macros in the modules MenuModule, modChartlabels and ThisWorkbook. These macros were copied from in the from web site

I modified the original macro in modChartlabels to this

 Option Explicit

Sub LastPointLabel()
    Dim mySrs As Series
    Dim nPts As Long
    Dim LastLabeled As Boolean
    If ActiveChart Is Nothing Then
        MsgBox "Please select a chart and try again.", vbExclamation
        For Each mySrs In ActiveChart.SeriesCollection
            LastLabeled = False
            nPts = mySrs.Points.Count
            For nPts = mySrs.Points.Count To 1 Step -1
                If Not mySrs.Values(nPts) = Empty Then
                    If LastLabeled = False Then
                        With mySrs
                            mySrs.Points(nPts).ApplyDataLabels _
                                    Type:=xlDataLabelsShowValue, _
                                    AutoText:=True, LegendKey:=False
                        End With
                        LastLabeled = True
                        mySrs.Points(nPts).HasDataLabel = False
                    End If
                End If
    End If
End Sub

Open in new window

Please note that the Quota series in your original file had C3:C15 and C23 which I changed to C3:C15

LVL 18

Accepted Solution

Curt Lindstrom earned 1400 total points
ID: 38776965
This version only has one macro which is the same modifed macro but without the modules MenuModule, modChartlabels and ThisWorkbook.

The macro is stored as a worksheet macro and activated when the Weekly Graphs sheet is opened.

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.


Author Comment

ID: 38779951

Thank you very much for all the responses and solutions are fantastic.
LVL 22

Expert Comment

ID: 38781053
Thank you. I realize my solution didn't address specifically what you were looking for (Value from a chart), but it showed that there was a non-VBA approach!
LVL 18

Expert Comment

by:Curt Lindstrom
ID: 38781268
You're welcome! Let me know if you need anything to be clarified.


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question