Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there is a function that I could use , where if a cell is equal to
Day1, it would show me an already created chart and if B1 is not "Day1" it would hide that chart? Any help is appreciated! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paste this in the code for the worksheet if your chart is a worksheet.
If it's an object, you can replace the sheet visible statement with the ActiveSheet.ChartObjects("Chartname").Visible = False Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$1" Then If Target.Value = "Day1" Then Sheets("Chart1").Visible = True ' <== change this if its an object Else Sheets("Chart1").Visible = False ' <== change this if its an object End If End If End Sub Rob wrote: Is there is a function that I could use , where if a cell is equal to Day1, it would show me an already created chart and if B1 is not "Day1" it would hide that chart? Any help is appreciated! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Right click the sheet tab and choose View Code. In the code module that
opens up, paste the following code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = Range("B1").Address Then Me.ChartObjects(1).Visible = (StrComp("Day1", _ Target.Text, vbTextCompare) = 0) End If End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) wrote in message ups.com... Is there is a function that I could use , where if a cell is equal to Day1, it would show me an already created chart and if B1 is not "Day1" it would hide that chart? Any help is appreciated! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank You! This worked perfect!
Thanks a lot... Chip Pearson wrote: Right click the sheet tab and choose View Code. In the code module that opens up, paste the following code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = Range("B1").Address Then Me.ChartObjects(1).Visible = (StrComp("Day1", _ Target.Text, vbTextCompare) = 0) End If End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) wrote in message ups.com... Is there is a function that I could use , where if a cell is equal to Day1, it would show me an already created chart and if B1 is not "Day1" it would hide that chart? Any help is appreciated! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As answered in .charting:
You can do this with named ranges and a linked picture. There's a sample file he http://www.contextures.com/excelfiles.html Under Charts, look for 'CH0002 - Show or Hide Chart' wrote: Is there is a function that I could use , where if a cell is equal to Day1, it would show me an already created chart and if B1 is not "Day1" it would hide that chart? Any help is appreciated! -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to show "yes" or "No" in a cell if certain criteria is met? | New Users to Excel | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
If cell B1 = "Day1" , show chart | Charts and Charting in Excel | |||
if "a" selected from dropdown menu then show "K" in other cell | Excel Worksheet Functions | |||
Pivot table "Group and Show Details" vs. "SubTotals" | Excel Programming |