Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default if Cell B1 = "Day1" show chart

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default if Cell B1 = "Day1" show chart

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default if Cell B1 = "Day1" show chart

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default if Cell B1 = "Day1" show chart

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default if Cell B1 = "Day1" show chart

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show "yes" or "No" in a cell if certain criteria is met? Bojan New Users to Excel 3 September 28th 08 10:36 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
If cell B1 = "Day1" , show chart [email protected] Charts and Charting in Excel 7 January 27th 07 07:08 PM
if "a" selected from dropdown menu then show "K" in other cell LEGALMATTERS Excel Worksheet Functions 1 April 13th 06 06:05 PM
Pivot table "Group and Show Details" vs. "SubTotals" pgchop Excel Programming 0 February 1st 06 07:29 AM


All times are GMT +1. The time now is 06:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"