ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to make graph invisible / invisisble (https://www.excelbanter.com/excel-programming/280203-code-make-graph-invisible-invisisble.html)

Rick[_19_]

Code to make graph invisible / invisisble
 
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

Don Guillett[_4_]

Code to make graph invisible / invisisble
 
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

"Rick" wrote in message
...
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




Mike Fogleman

Code to make graph invisible / invisisble
 
ActiveSheet.ChartObjects.Visible = False
ActiveSheet.ChartObjects.Visible = True

"Rick" wrote in message
...
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




[email protected]

Code to make graph invisible / invisisble
 
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
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
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




All times are GMT +1. The time now is 04:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com