Solved

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

Posted on 2015-02-23
2
106 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

776 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