Chart question

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
 
D

Don Guillett

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top