Fixing a Macro Button

Bright01
Bright01 used Ask the Experts™
on
EE Pros,

I have a WS that has a Macro Button for expanding and collapsing a outline form.  In building out several new capabilities, this Macro Button got replicated and from within the code itself, produces additional buttons (on top of each other).  It comes from defining two range names (why?  I don't know) but for some reason it's these range names and their location in the code that is now affecting the ability to have the WS behave correctly.

Code attached,

B.
D--Data-Data-Temp-Copy-of-28820120b.xlsm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
There's currently no code associated with that button. Is it supposed to be associated with Sheet1.button_Click or Sheet1.Expand_Summary?
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
When I associate it with Sheet1.Expand_Summary and collapse the use cases down to just their header rows, clicking it expands the use cases. I don't see any problem.

Author

Commented:
Martin,

You are correct. However, the reason there is no code behind the gray button, is because you are looking at a copy of the button.  If you delete several of them, you will then see a Button 9, Button 8, Button 7.....delete them all until you get down to the original button which does have code behind it.  Now fire the Blue Button and you will see an error.

B.
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Older than dirt
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
OK. The last button is associated with Sheet1.button_Click which protects the sheet at the end and the blue button won't work while the sheet is protected, so either remove the protect/unprotect code from button_click or add it to ToggleDisplay.

Author

Commented:
I should have caught that!   ;-)

Thank you!

B.

Author

Commented:
Martin,

I've issued a new question to fix the math in the selected boxes.  Right now if you remove all check marks, the value in the sum cell (bottom of the table) still has a value.  It should read -0-.

Here is the new post.  Hope you will take a look.

http://www.experts-exchange.com/questions/28826919/A-Fix-to-the-Check-Boxes-and-Math.html

Best regards,

B.

Author

Commented:
Oh.... the attached file is slightly updated (no coding changes) ...... I simply changed the button but no code changes except to make the txt in an unselected box darker.  Nice touch!  Thanks for the tip.

B.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial