Consulting

Results 1 to 7 of 7

Thread: Solved: Do a Visible and Invisible Graph

  1. #1

    Talking Solved: Do a Visible and Invisible Graph

    Hi !!!!

    I want to do some alterations in the file and a need some help...
    First:
    In the cell C4 and C5 I want to introduce something that only allows to place a X... or place an X in cell C4 or in Cell C5... the person can not put two cell at the same time.

    Second:
    The letters in red must be invisible and blocked

    Third:
    Everything the rest must be visible but blocked, in a way the n that nobody can change

    Last and more difficult,
    If the cell C4 has a X, then just appears the graph 2 and the graph 1 disappears
    If the cell C5 has a X, then only appears the fr?fico 1 and the graph two disappears

    Please look at the attach file....

    Thankssssssssssss


  2. #2

    I forgot something...

    sorry, i forgot to say that:

    the cells in yellow are for the person to fill, i want they be visible and not blocked.

    sorryyyyyy

    Thanks


  3. #3
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location
    Hi Ricardo Rosa,


    Well I did everything you ask for except I can't figuer it out how to to hide the charts. I'm just a youngster in VBA I was getting closes but I'm missing something. I also updated your chart creating a OFFSET range for your chart. So if you enter your data say in cell K19 and L19 it will automatically update your chart. Well here is the code that it suppose to hide the chart but maybe someone on this forum could help you with that.

    See the attachment!



    [VBA]
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$C$4" Then
    ActiveSheet.ChartObjects("Chart 1").Visible = True
    On Error Resume Next
    ActiveSheet.ChartObjects("Chart 1").Visible = False
    If Target.Address = "$C$5" Then
    ActiveSheet.ChartObjects("Chart 2").Visible = True
    On Error Resume Next
    ActiveSheet.ChartObjects("Chart 2").Visible = False

    End If
    End Sub
    [/VBA]




  4. #4
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location
    Well I found another solution. You have data by Day how about by Month also? I added the Month data next to Day data in your worksheet. So If you put X in cell C4 the chart will displays the Day data.

    But

    If you put an X in C5 it will dsiplays Month data. So you dont need 2 charts in the worksheet just 1 chart.

    Let me know what you think?

    See the Attachment!

  5. #5
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    Note: I edited this thread to reduce the case of the title from ALL CAPS to Title Case.

  6. #6
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location
    Ok I finally Figuered it out. This is how it works.

    In Cell C4 has a "X" it will hide chart 3 But if you delete the "X" in cell C4 it will hide Chart 1 and Unhide Chart 3. The chart you have is defaulted as Chart 3 thats why I could not get it to work. Here is the the code.


    [VBA]
    Private Sub Worksheet_Change(ByVal Target As Excel.Range)

    If Worksheets("Sheet1").Range("C4") = "X" Then
    ActiveSheet.ChartObjects("chart 1").Visible = True
    ActiveSheet.ChartObjects("chart 3").Visible = False
    Else
    ActiveSheet.ChartObjects("chart 1").Visible = False
    ActiveSheet.ChartObjects("chart 3").Visible = True
    End If
    End Sub
    [/VBA]

  7. #7

    Solved

    Hi,

    yes!!! it's done... your code works in perfection...

    I'm just arrived from a small vacation, that's why i'm just reply now...

    Thanks

Posting Permissions

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