Thread: Hiding charts
View Single Post
  #2   Report Post  
mikerickson mikerickson is offline
Junior Member
 
Location: Winters CA
Posts: 22
Default

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("chart 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

Quote:
Originally Posted by dan View Post
Please help me with a vba program that will hide and show on command.
Thanks