Thread: Hiding charts
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 38
Default Hiding charts

Very nice! Thank you, Mike

"mikerickson" wrote in message
...

I assume from the title you mean hide/unhide charts. The format menu has
a Chart - Hide option.
If your chart is imbedded on sheet1, this routine will toggle its
visiblity

Code:
--------------------
Sub toggleImbeddedChart()
With ThisWorkbook.Worksheets("sheet1").ChartObjects("ch art 1")
.Visible = Not (.Visible)
End With
End Sub
--------------------

This will toggle a chart sheet.

Code:
--------------------
Sub toggleChartSheet()
With ThisWorkbook.Sheets("Chart1")
.Visible = Not (.Visible)
.Activate
End With
End Sub
--------------------



dan;510529 Wrote:
Please help me with a vba program that will hide and show on command.
Thanks





--
mikerickson