Chart question

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

Hi,

I have two charts and would like only one of them to be
visible at anuy one time. They occupy the same area of
the screen and would like to add a button or two to
toggle them on or off. I have run a macro which selects
one of the charts and then use Send to Back. However when
attaching the code from this macro to the button I get an
error. Can anyone help?

Thanks,
Matt
 
This will toggle hiding/unhiding a chart
Sub hideunhidechart()
Sheets("Sheet5").ChartObjects("Chart 1").Visible = _
Not Sheets("Sheet5").ChartObjects("Chart 1").Visible
End Sub
 
Back
Top