Code to change a radio buttons properties

Smurfit-Stone

Active Member
Joined
Dec 1, 2004
Messages
485
Hello Board,

I'm trying to write code to clear a user form that has a series of radio buttons. I need to clear the form (template) to use over again. So far I have this.

ActiveSheet.Shapes("OptionButton14").Select

What I need to do now is change the properties.value from true to false. But no matter what I write or record, it doesn't work. I can't use checkboxes, because I need to force the user to select either on or the other in the group of buttons. There are 10 groups with 2 buttons each. I will need to reset the form and have the 10 groups buttons clear. Can anyone help? Thanks in advance.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You can change the value to FALSE such as

OptionButton1.Value = False

or, if you have a "na" button that is grouped with other buttons, you can set that button to true and it will make all others false.
 
Upvote 0
THANK YOU, THANK YOU, THANK YOU. It is such a blessing to be able to come to this site and get answers to excel problems. Thanks again!


Sorry, but this bit of code did not work
 
Last edited:
Upvote 0
THANK YOU, THANK YOU, THANK YOU. It is such a blessing to be able to come to this site and get answers to excel problems. Thanks again!


Sorry, but this bit of code did not work[/QUOTE]
 
Upvote 0
So, when you say "user form" is it a userform in this sense of the word:
http://www.contextures.com/xluserform01.html

Or is it a worksheet (tab) with some controls on it, and if so, are they active x or form controls?

Given that the code I gave you was for the first example, I'd assume yours is the second.
 
Upvote 0
Did you change CWatts' code from:
"OptionButton1"
to
"OptionButton14"
to match your button number?
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top