Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Dynamic Visibility of Charts Through Checkbox Selection

Hi,

I'm trying to base the visibility of a chart off of whether a specific
checkbox is selected or not. What should I be doing differently in my
code?

Sub ChangeChartVisibility()
Dim tc As Object, cb As Object
Set tc = Application.ActiveSheet.ChartObjects("Chart 3")
Set cb = Application.ActiveSheet.MsForms.CheckBox("VolumeIn dicators")

If cb.Enabled = True Then
tc.Visible = True
Else
If cb.Enabled = False Then
tc.Visible = False
End If


End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Dynamic Visibility of Charts Through Checkbox Selection

Hi,

Maybe you want to use the Value rather than whether the control is enabled
or not.

Sub ChangeChartVisibility()
Dim tc As Object, cb As Object
Set tc = Application.ActiveSheet.ChartObjects("Chart 3")
Set cb = Application.ActiveSheet.MsForms.CheckBox("VolumeIn dicators")

tc.Visible = cb.value

End sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"R Tanner" wrote in message
...
Hi,

I'm trying to base the visibility of a chart off of whether a specific
checkbox is selected or not. What should I be doing differently in my
code?

Sub ChangeChartVisibility()
Dim tc As Object, cb As Object
Set tc = Application.ActiveSheet.ChartObjects("Chart 3")
Set cb = Application.ActiveSheet.MsForms.CheckBox("VolumeIn dicators")

If cb.Enabled = True Then
tc.Visible = True
Else
If cb.Enabled = False Then
tc.Visible = False
End If


End Sub


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
selection and visibility, lost charts Rene Charts and Charting in Excel 0 January 19th 09 11:40 PM
Dynamic data selection for charts sudheera Charts and Charting in Excel 1 June 10th 08 09:08 AM
Allow selection of only 1 checkbox Les Linton Excel Discussion (Misc queries) 3 October 11th 07 03:19 PM
CheckBox Selection Soniya[_4_] Excel Programming 1 April 24th 05 11:44 AM
Dynamic color selection in charts Anat[_3_] Excel Programming 2 November 22nd 04 12:41 PM


All times are GMT +1. The time now is 02:36 AM.

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

About Us

"It's about Microsoft Excel"