Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 27th, 2011, 12:10 AM
Authorized User
Join Date: May 2009
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to eliminate zero value labels in a pie chart

We have pie charts in a many tab workbook. The data in the charts (that is. the source of the chart's data) vary depending upon entries in other tabs. Usually we get a really nice pie chart with slices of different colors for various options and a label by each slice to tell the percent of the whole that it represents.

My problem is that sometimes, some of the results are a zero. In the pie graphic, that is not an issue and there just is no slice for that component.

BUT, this still generates a label showing 0%. Which appears to relate to nothing.

Is there any way to have any labels with a zero value not appear? Either not be generated to begin with, or be formatted so as not to be visible? I cannot find any settings anywhere in Excel that indicated that this is even possible, let alone tell how to do it. Of course we could deleted those labels when they are zero, but that would make the chart not work correctly the next time we use it.

We do not want to eliminate the zero value cell in the supporting "table." For a variety of reasons. (For starters, we want the client to see the table form of the data and we want the slices referring to each specific "variable" to always be the same color. I suspect other issues in formatting consistency would arise if we just removed a row of data.)

The chart is part of a financial planning workbook, with a lot of raw data entered about the person in an INPUT tab, and then all sorts of analyses and recommendations in additional tabs based upon the INPUT tab.

The point is that we would look to use the spreadsheet over and over again and would prefer not to have to manually format any part of the pie chart to cater to specific data input.
Old April 27th, 2011, 01:31 AM
Registered User
Join Date: Apr 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts


If you are using Excel 2007 or later you can right click on the pie chart and choose Format Data Labels... Then you have various options to work with. If you select percentage the zero values do not show, or at least on my system they do not. There is also the option to set user defined number styles which should help you do what you need.

Best regards


Similar Threads
Thread Thread Starter Forum Replies Last Post
3d pie chart Sunilmesu Pro Visual Basic 2005 0 April 30th, 2008 04:32 AM
Pie Chart jomet Pro JSP 2 March 10th, 2008 10:42 PM
Help on Pie Chart DudeBori82 Classic ASP Professional 9 May 3rd, 2005 04:24 PM
Pie-Chart crmpicco Javascript How-To 2 February 10th, 2005 06:34 AM
Pie Chart lryckman Access 0 April 26th, 2004 11:44 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.