Link to home
Start Free TrialLog in
Avatar of Bright01
Bright01Flag for United States of America

asked on

Displaying Graphic On and Off

I have this great little chart/graph that both Teylyn and Brad (Byuntd) helped me create (actually, they did most of the creating while I only assembled and did some learning).  I have the graphic on a single worksheet and have linked it into a front end sheet at a reduced size, (via copying the original chart/graphic and a macro that keeps it dynamically updated between worksheets.  Here's my question.  Is there some simple macro code I can use (button activated) that will toggle off and on the graphic (i.e. display it, hide it) on the target worksheet?  And do I load the code into the worksheet or a module?

Thank you in advance,

B.
Avatar of byundt
byundt
Flag of United States of America image

You can toggle the visibility of the chart using the following macro in a regular module sheet:

Sub ToggleChartVisibility()
With Worksheets("Target").ChartObjects(1)
    .Visible = Not .Visible
End With
End Sub

Open in new window


Brad
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bright01

ASKER

Brad,

Great work!  Killer App. (as far as you can take an Excel Workbook that is!).

Appreciate the tips, pointers, updates and hard work.

B.