Juan Velasquez
asked on
How to set Y axis formatting to zero places.
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
or
.Axes(2).TickLabels.Number Format = "#,##0"
.Axes(2).TickLabels.Number
ASKER
Hello Phillip,
I was working on the problem and I came up with .Axes(2).TickLabels.Number Format = "%##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.
I was working on the problem and I came up with .Axes(2).TickLabels.Number
Are your Y axis values percentages?
If so, then this should work:
.Axes(2).TickLabels.Number Format = "0%"
Thanks
Rob H
If so, then this should work:
.Axes(2).TickLabels.Number
Thanks
Rob H
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everyone. I should have been more specific. I'll split the points. Thanks again.
I was reading "%" as a wildcard! I'm doing too much SQL Server.
.Axes(2).TickLabels.Number