Solved

Can't add data labels to data series on secondary axis

Posted on 2015-02-23
2
102 Views
Last Modified: 2016-02-10
Hello,
I've been trying to add data lables to a line data series on a secondary axis via vba.  The labels are not being displayed.  When I try to add the data labels manually, I get the following message, "The maximum number of data labels that can be displayed is 1000.  Some labels will be remitted from the chart"  .  The chart contains only 100 labels. I've attached the pdf file of the chart.

With objNewSeries
            .Name = "Aggregate LIFR (Non-NEX)"
            .Values = objXlDataSheet.Range("F:F")
            .AxisGroup = 2
            .ChartType = 65
            .Format.Line.Weight = 1
           .ApplyDataLabels
         .DataLabels.NumberFormat = "0.0%"
        End With

Open in new window

PDF-File.pdf
0
Comment
Question by:chtullu135
2 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40627537
Hi,

maybe you could restrict the range

instead of

.Values = objXlDataSheet.Range("F:F")


.Values = objXlDataSheet.Range(Range("F1"), Range("F" & Cells.Rows.Count).End(xlUp))


Regards
0
 

Author Closing Comment

by:chtullu135
ID: 40634235
Thanks that's what I needed.  I just needed to modify the provided code so that it would work using late-binding.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now