ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   How do you hide a bar chart in Excel (https://www.excelbanter.com/charts-charting-excel/208627-how-do-you-hide-bar-chart-excel.html)

bhowell

How do you hide a bar chart in Excel
 
I have a bar chart that I would like to hide so I can possibly assign it to a
macro and have it unhide and hide at the push of a button. Does anybody know
if this is possible or any other ways to do it? Thanks.

ShaneDevenshire

How do you hide a bar chart in Excel
 
Hi,

take a look at the command Tools, Options, View tab, Show Placeholders or
Hide All. You can record a macro to toggle this on and off.

Sub ToggleCharts()
If ActiveWorkbook.DisplayDrawingObjects = xlHide Then
ActiveWorkbook.DisplayDrawingObjects = xlDisplayShapes
Else
ActiveWorkbook.DisplayDrawingObjects = xlHide
End If
End Sub

--
Thanks,
Shane Devenshire


"bhowell" wrote:

I have a bar chart that I would like to hide so I can possibly assign it to a
macro and have it unhide and hide at the push of a button. Does anybody know
if this is possible or any other ways to do it? Thanks.


Jon Peltier

How do you hide a bar chart in Excel
 
If it's a chart sheet, you can use

Charts("sheet name").Visible = True/False

If it's an embedded chart, you can use

ActiveSheet.ChartObjects(x).Visible = True/False

where x is either the number of the chart object or the name of the chart.
To learn about chart names, see:
http://peltiertech.com/Excel/ChartsH...ameAChart.html

The simplest macro would be:

Sub ToggleChartVisibility()
Charts("sheet name").Visible = Not Charts("sheet name").Visible
End Sub

To learn about assigning macros to buttons:
http://peltiertech.com/WordPress/200...tton-or-shape/

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"bhowell" wrote in message
...
I have a bar chart that I would like to hide so I can possibly assign it to
a
macro and have it unhide and hide at the push of a button. Does anybody
know
if this is possible or any other ways to do it? Thanks.




Jon Peltier

How do you hide a bar chart in Excel
 
That doesn't do one chart, it does all of the charts and shapes on the
sheet. It might do what the OP wanted, but not what I interpreted that he
wanted.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"ShaneDevenshire" wrote in
message ...
Hi,

take a look at the command Tools, Options, View tab, Show Placeholders or
Hide All. You can record a macro to toggle this on and off.

Sub ToggleCharts()
If ActiveWorkbook.DisplayDrawingObjects = xlHide Then
ActiveWorkbook.DisplayDrawingObjects = xlDisplayShapes
Else
ActiveWorkbook.DisplayDrawingObjects = xlHide
End If
End Sub

--
Thanks,
Shane Devenshire


"bhowell" wrote:

I have a bar chart that I would like to hide so I can possibly assign it
to a
macro and have it unhide and hide at the push of a button. Does anybody
know
if this is possible or any other ways to do it? Thanks.





All times are GMT +1. The time now is 12:58 AM.

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