Code to make graph invisible / invisisble

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

Hello:

I am a VERY little bit familiar with VBA and am wondering
if someone can assist me in the code necessary to make a
chart disappear / reappear by clicking a command button.

thanks,

Rick
 
try this assigned to a button or shape. I don't like command buttons but do
it if you like.
One click hides the next unhides

Sub togglechart()
ActiveSheet.ChartObjects("Chart 1").Visible = Not
ActiveSheet.ChartObjects("Chart 1").Visible = True
End Sub
 
Watch for linewrap (All one line). Toggles visibility on and off.

Sub Tester()
ActiveSheet.ChartObjects("Chart 95").Visible = Not
ActiveSheet.ChartObjects("Chart 95").Visible
End Sub

Tested using Excel 97SR2 on Windows 98SE,

HTH
Paul
 
Back
Top