Deactivate a Form Button or a Form OptionButton in Excel 2016?

Klash Ville

Board Regular
Joined
Sep 19, 2017
Messages
83
How can I deactivate a Form Button or a Form OptionButton in excel 2016?

I have did many research on this, but everyone's solutions are either based on older versions of excel or on ActiveX...

Code:
Right now, in order to simulate an object (and it's code) deactivation, I'm simply assigning them an empty macro and making its label greyed out...
 
Last edited:

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

than_gold

New Member
Joined
Sep 18, 2017
Messages
21
Hello Klash Ville ,
You can use the below code to deactivate the Form Button.

<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">CommandButton1.Enabled = False

Regards,
Thangavel D
</code>
 

Watch MrExcel Video

Forum statistics

Threads
1,099,082
Messages
5,466,534
Members
406,484
Latest member
kaksolver

This Week's Hot Topics

Top