Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello:
I would appreciate help with the following: I have about 5 different charts on a worksheet. Is there a way that I can hide/unhide the charts so that I can display only one at a time. I plan to use a List through 'Data', 'Validation', so that the user can select the chart to be viewed from a drop down list (eg. Chart1, Chart2,...... Chart5) Thus when the user selects say Chart 2 from the drop down list, Chart2 is displayed & other charts are hidden. TIA Vinay |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try:
Private Sub Worksheet_Change(ByVal Target As Range) Dim chrt As ChartObject If Target.Count = 1 And Target.Address = "$F$1" Then For Each chrt In ActiveSheet.ChartObjects If chrt.Name < Target.Value Then chrt.Visible = False Else chrt.Visible = True End If Next chrt End If End Sub This is worksheet event code. Right click the sheet tab, select View Code and paste the code in there. I have assumed that the Data Validation cell is in F1 - change as required. Your list of names will need to match the names of the charts exactly. If you have used the default names the probably "Chart 1", "Chart 2" etc. Hope this helps Rowan wrote: Hello: I would appreciate help with the following: I have about 5 different charts on a worksheet. Is there a way that I can hide/unhide the charts so that I can display only one at a time. I plan to use a List through 'Data', 'Validation', so that the user can select the chart to be viewed from a drop down list (eg. Chart1, Chart2,...... Chart5) Thus when the user selects say Chart 2 from the drop down list, Chart2 is displayed & other charts are hidden. TIA Vinay |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hide/Unhide | Excel Discussion (Misc queries) | |||
hide/unhide | Excel Discussion (Misc queries) | |||
Hide Unhide | Excel Discussion (Misc queries) | |||
Hide/unhide | Excel Worksheet Functions | |||
hide/unhide | Excel Programming |