Discussion Locked

Excel Zero Values in Pie Charts

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a percentage pie chart that is built from formulas that reference data that is updated daily. Often several of the 12 categories have 0% in the chart. I need to show the labels and data on the chart but I get all my zeros and their labels stacked in a jumbled mess. Can I just show labels and values on the chart that are greater than 0. Don't say uncheck zero values on the options/view tab. That doesn't fix the chart problem. Thanks

7 replies

by willyray

I should clarify. I have a 12x6 data table that I use to populate 6 ie charts. A filter takes out and entire row so that I end up with some charts completely blank. I'm looking for a charting option that will not show the zero's and their labels. Nice try...

by dklippert

Here's a macro from Jon Peltier, Microsoft Excel MVP

"You also could use a macro that removed any labels from points with zero
values:

Sub RemoveZeroLabels()
Dim nPts As Long, iPts As Long

For iPts = 1 To ActiveChart.SeriesCollection(1).Points.Count
If WorksheetFunction.Index( _
ActiveChart.SeriesCollection(1).Values, iPts) = 0 Then
ActiveChart.SeriesCollection(1).Points(iPts).HasDataLabel = False
End If
Next

End Sub

by willyray

I was looking for some setting in Excel but I like your solution. Thanks for the help. I tinker with VBA and would like to do more. Can you recommend a good VBA resource?

This discussion is closed to new replies.