Userform controls visited question


Board Regular
Jan 22, 2005
Good Day, all. Here's what I'm trying to do.

I have a Userform with several option buttons. As the user selects one option button, other option buttons are Enabled depending on the user's choice. No problem here. At a point in the process when the user makes a particular choice, I want the all of the rest of the controls to be Enabled, EXCEPT the controls not previously chosen.
In other words, when the user makes a choice, the other options in that group are disabled, so that the user can easily see which choices were made.
My approach has been to create a variable to receive the option button name as it's selected. Then turn on all controls. Then loop back through all the controls on the Userform, comparing them to the items in the variable containing the previously selected controls. If the control is not in the previously selected group, turn it off.

In other words, I want to turn on all of the controls which were not previously disabled. Maybe there is a better way to do this. I'm definitely open to suggestions

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

for me this is not clear
at a certain point I even thought you were mixing enabled and disabled

anyone ?
else my suggestion would be to explain again...

kind regards,
Upvote 0
Well... It seems that you have already answered your own question. You are going to have to store the custom state of each option button. I would use the tag property in each control. This way, you could create one procedure that loops through all of your option buttons and sets the enabled property depending on the value stored in each controls tag property. Your logic is not very clear so I am going on a hunch here...
Upvote 0
Thanks for the reply. I never do a good job of explaining what I need. Let me give it another shot, without getting TOO detailed.
I'm creating a Userform that is like going into a car dealer and ordering a new car. The Userform opens with only the Model number Enabled (chooseable) and all the rest are not Enabled (grayed). When you select the base model number, depending on the model number, another set Option buttons are enabled. Each time you make a selection in each set of Option buttons, I want the rest of the buttons in the group grayed. But at the same time, I want to leave Enabled the buttons I selected in previous groups. This way the user can see all the Options he selected along the way.
As for the variable, I don't know which properties to trace (by Name, Count, Item), or how broad the variable should be (Controls collection, Worksheet collection), or maybe something else.
I hope you can make some sense of this. Thanks for your time.
Upvote 0
Ok Dave. Sure. You can do this but do you want to disable your controls for the lone purpose of how the control is displayed? What if the user wishes to correct an earlier selection? How are you going to compensate for that?
Upvote 0
Great question. I have OptionButtons for "must choose between" choices, and CheckBoxes for "I want this, too" choices. Also, I have a "Clear Form" button which disables and clears all choices and returns the user to the Model Selection.
Upvote 0
Ok Dave. If this is not what you are looking for, please correct me and send me your file or export your userform too me.

Upvote 0
it looks to me as you could do this using some dependent comboboxes

when selecting option "large cars" the next box would get only a list with large cars
then you could select "4 doors"
and so on ...

would this be an option ?
Upvote 0
Sounds like a good idea too me! :)
Hi, Tom,

then let's dig up a "standard"
take a look at this "famous" thread
(the link is already pointed to the "most relevant post")
but this is not what dave3944 would need in this case

for a technique using comboboxes

see also this explanation


feel free to send an email (no PM)
you'll get three files with examples

subject of email
cascading comboboxes

kind regards,
Upvote 0

Forum statistics

Latest member

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
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 "".
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