Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
selection and visibility, lost charts | Charts and Charting in Excel | |||
Dynamic data selection for charts | Charts and Charting in Excel | |||
Allow selection of only 1 checkbox | Excel Discussion (Misc queries) | |||
CheckBox Selection | Excel Programming | |||
Dynamic color selection in charts | Excel Programming |