Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Hide & Unhide Charts

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Hide & Unhide Charts

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
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
Hide/Unhide [email protected] Excel Discussion (Misc queries) 0 July 24th 08 05:02 PM
hide/unhide brownti Excel Discussion (Misc queries) 3 February 6th 07 07:14 PM
Hide Unhide Colin Excel Discussion (Misc queries) 4 April 9th 06 05:01 PM
Hide/unhide Jock W Excel Worksheet Functions 4 October 4th 05 05:02 PM
hide/unhide heartbreakkid Excel Programming 6 May 7th 04 10:13 PM


All times are GMT +1. The time now is 09:17 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"