Radio Buttons in VBA UserForms

G

Guest

I have created a userform in VBA which allows the user to input into an excel
spreadsheet with a userfom.

Within the form there are a number of Radio Buttons. When the form is active
and the radio buttons have been selected they can no longer be deselected. I
would like to be able to do this as it is possibe a user could select a user
form by accident.

Can you please help?
 
V

Vasant Nanavati

Without knowing more about your application, perhaps you can use checkboxes
instead of option buttons.
 
K

Ken Macksey

Hi

You could add an extra radio button that says "Other", or one that says
"clear selections".
The "Other" button would need no code. The "Clear Selections" button could
be coded something like this

Userform1.OptionButton1.Value = False
Userform1.OptionButton2.Value = False
Userform1.OptionButton3.Value = False

or assuming your buttons are all within a frame, you could put a command
button in the bottom of the frame that says "Clear Selections" and use the
same code to clear the Radio buttons.

There does not seem to be a simple elegant solution. Maybe someone else has
some ideas.

HTH

Ken
 
G

Guest

Radio buttons are designed to work together within a frame, for when the user
needs to select one of several mutually excluxive choices. Choosing one
deselects any prior choice. If you only have one button, it cannot be
deselected because there is no alternative choice to select. Group the radio
buttons within a frame, or use checkboxes instead.
 
F

funkymonkUK

are you refering to the fact that on the form you have lots fo radio
buttons that when the user presses one does


A) not allow you select other radio buttons


or

B) you want the user to only be able to press one radio button eg your
have a question which is just a yes/no answer you only want them to be
able to choose yes or no and not both.

I can help you out if you help me understand your problem
 
G

Guest

No what I have in my userform are a number of yes/no question, however they
all do not have to be answered. What I want to do is that if the users clicks
on one by mistake is for them to be able to rectify that mistake by clicking
on the radio button again, or something similar.

Thanks

Nick
 

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