Solved

How to set Y axis formatting to zero places.

Posted on 2015-01-26
8
89 Views
Last Modified: 2015-01-27
I'm creating a chart via vba from within Access using late binding.  I am able to create the chart but the Y axis is displaying the percentage values to 2 places.  I tried setting it to "%00" but it is putting adding a zero to the zero value so that it appears like "%00"  .  I am also trying to display the y value for each bar within their respective bars.

With objXlChart
        .ChartType = 52
        .SetSourceData Source:=Range("PercentageAvailByPlanner!$A$1:$B$11")
        
        .PlotBy = 2
        '.Location where:=2, Name:="Percent Available By Planner"
        .HasTitle = True
        .HasLegend = True
        .Axes(2).TickLabels.NumberFormat  = "%00"    


    End With

Open in new window

0
Comment
Question by:chtullu135
  • 4
  • 2
  • 2
8 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
Comment Utility
Does this not work?

        .Axes(2).TickLabels.NumberFormat  = "0"
0
 
LVL 24

Expert Comment

by:Phillip Burton
Comment Utility
or

        .Axes(2).TickLabels.NumberFormat  = "#,##0"
0
 

Author Comment

by:chtullu135
Comment Utility
Hello Phillip,
I was working on the problem and I came up with .Axes(2).TickLabels.NumberFormat = "%##0".  I tried "#,##0" when I read your post, but it displayed the value rounded to the most significant digit so that %100 appeared as 1  I think that is more to do with how the source data is set.  However, your solution was helpful.  Thanks.
0
 
LVL 31

Expert Comment

by:Rob Henson
Comment Utility
Are your Y axis values percentages?

If so, then this should work:

.Axes(2).TickLabels.NumberFormat  = "0%"

Thanks
Rob H
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 250 total points
Comment Utility
It wasn't obvious to me that your figures were percentages.

If they were, then Rob's answer should work.

It doesn't round it to the most significant digit. It rounds it to zero decimal places, which was what was requested.
0
 
LVL 31

Accepted Solution

by:
Rob Henson earned 250 total points
Comment Utility
I was merely assuming % by the use of %00 in the question.
0
 

Author Closing Comment

by:chtullu135
Comment Utility
Thanks everyone.  I should have been more specific.  I'll split the points.  Thanks again.
0
 
LVL 24

Expert Comment

by:Phillip Burton
Comment Utility
I was reading "%" as a wildcard! I'm doing too much SQL Server.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
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…

771 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