-
-
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
-
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]
-
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!
-
Note: I edited this thread to reduce the case of the title from ALL CAPS to Title Case.
-
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]
-
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
-
Forum Rules