+ Reply to Thread
Results 1 to 3 of 3

Is there a way to hide/unhide graphs conditionally?

Hybrid View

  1. #1
    Registered User
    Join Date
    06-25-2014
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    4

    Is there a way to hide/unhide graphs conditionally?

    Hi all,

    Is there a way to hide/unhide graphs based on a certain criteria/condition? From what I know you cannot use objects such as graphs in formulas (such as an if statement in this case). What I am looking to do specifically is hide certain graphs from showing if certain data cells in my spreadsheet are blank/zero.

    Thank you in advance

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

    Re: Is there a way to hide/unhide graphs conditionally?

    Here is a very simple UDF to make chart object visible or not.

    Public Function udfChartVisible(Name As String, State As Boolean)
        On Error GoTo ErrChartVisible
        ActiveSheet.ChartObjects(Name).Visible = State
        udfChartVisible = State
        Exit Function
        
    ErrChartVisible:
        udfChartVisible = CVErr(xlErrRef)
        Exit Function
    End Function
    Change the visible state in cells C3 or C4
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-25-2014
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    4

    Re: Is there a way to hide/unhide graphs conditionally?

    Thanks a lot Andy

+ 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. [SOLVED] Macro to conditionally hide/unhide rows
    By BeardedF in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-12-2012, 05:25 PM
  2. Hide of Unhide Graphs in Excel 2007
    By friendharshad in forum Excel General
    Replies: 0
    Last Post: 07-27-2012, 01:34 PM
  3. Hide Unhide worksheets conditionally
    By ufopilot3 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2012, 11:32 AM
  4. Help with Conditionally formatted line graphs
    By compulsiveguile in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 08-11-2008, 09:18 AM
  5. [SOLVED] conditionally hide/unhide rows
    By ajbazinet in forum Excel General
    Replies: 1
    Last Post: 09-09-2005, 04:05 PM

Tags for this Thread

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