+ Reply to Thread
Results 1 to 2 of 2

Hide pie charts if chart is blank/empty?

  1. #1
    Forum Contributor
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2013
    Posts
    131

    Hide pie charts if chart is blank/empty?

    Hey folks!

    I just spent the better part of an hour searching for how to do this and haven't been able to figure out the limited VBA examples that're out there to fit my needs. Turning to the forum in hopes of getting some help/suggestions.

    What I want to do is pretty straight forward:

    I have 9 pie charts on a sheet. Sometimes all 9 will have data to show, sometimes only 2 charts will have data to show, or 5 charts, etc.

    I simply want to put some VBA code together that'll cycle through the charts, and if there are no data points to show (i.e. all blanks or all 0), I'd like to just hide the chart since it's not displaying anything of use.

    My charts used named ranges for the data source, but otherwise it's all pretty plain jane.

    Don't necessarily need someone to write code for me (unless you're feeling it, in which case I won't stop you :P), but would just love a gentle shove in the right direction so I can figure this out and move on with my project.

    Any help is greatly appreciated!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: Hide pie charts if chart is blank/empty?

    I think the issue is knowing when the pie is truly empty. If it is just the cells content that is changing then the series points count will remain the same.

    You would need to check the Values property of the series.

    Please Login or Register  to view this content.
    This would still display the chart even if all the values where zero. You would need to make the call on whether zero is a valid data point.
    If yes, then you would need to modify the code to check length and actual values
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hide empty formulas with blank cells
    By shawn.h1988 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2018, 02:20 PM
  2. Replies: 11
    Last Post: 03-22-2018, 03:54 AM
  3. HELP: How to hide empty or blank columns/cells?
    By nez329 in forum Excel General
    Replies: 10
    Last Post: 11-07-2014, 11:27 AM
  4. [SOLVED] Macro to hide blank (not empty) rows
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2013, 03:09 PM
  5. How do I not include empty cell value chart labels in pie charts?
    By JMarble in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-13-2005, 04:06 PM
  6. How do I remove empty chart plots from linked worksheet charts
    By Lee IT in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-31-2005, 01:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1