How to make a checkbox on a chart invisible when it is clicked?

  • Thread starter Thread starter Naum
  • Start date Start date
N

Naum

How to make a checkbox on a chart invisible when it is clicked? I have some
code which hides a coulmn when a checkbox is clicked. Now my users want not
only hide the column, but also get the checkbox itself to "go away" - I
translate it as "make invisible "

Now I have the code:

Sub Check_Box_Click()

Sheets("Summary_Worksheet").Select
Select Case Application.Caller
Case "cbI40"
Columns("I").Select
Case "cbJ40"
Columns("J").Select
Case "cbK40"
Columns("K").Select
Case Else
End Select

If Selection.EntireColumn.Hidden = False Then
Selection.EntireColumn.Hidden = True
Else
Selection.EntireColumn.Hidden = False
End If

Sheets("Star-plot").Select

End Sub

I want to get something like that working:


Sub Check_Box_Click()

Sheets("Summary_Worksheet").Select
Select Case Application.Caller
Case "cbI40"
ActiveSheet.Shapes("cbI40").Select ==> I know that is wrong (it does
not work)
Selection.Hidden = True
Columns("I").Select
Case "cbJ40"
ActiveSheet.Shapes("cbJ40").Select ==> I know that is wrong (it does
not work)
Selection.Hidden = True
Columns("J").Select
Case "cbK40"
ActiveSheet.Shapes("cbK40").Select ==> I know that is wrong (it does
not work)
Selection.Hidden = True
Columns("K").Select
Case Else
End Select

If Selection.EntireColumn.Hidden = False Then
Selection.EntireColumn.Hidden = True
Else
Selection.EntireColumn.Hidden = False
End If

Sheets("Star-plot").Select

End Sub

the plan is that appropriate checkbox will became hidden first and then
appropriate column will be selected and in the If than else whichever column
is selected, will get hidden as well (part with columns works fine)

Thank you
 
Hi Naum,

Try this

activesheet.checkboxes("CBI40").visible=false

and so on.


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Back
Top