Userform controls visited question

dave3944

Board Regular
Joined
Jan 22, 2005
Messages
139
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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi,

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,
Erik
 
L

Legacy 98055

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

dave3944

Board Regular
Joined
Jan 22, 2005
Messages
139
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.
 
L

Legacy 98055

Guest

ADVERTISEMENT

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?
 

dave3944

Board Regular
Joined
Jan 22, 2005
Messages
139
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.
 
L

Legacy 98055

Guest

ADVERTISEMENT

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.

Thanks

dave3944.zip
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
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 ?
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
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")

http://www.mrexcel.com/board2/viewt...=0&postorder=asc&highlight=cascading&start=26
but this is not what dave3944 would need in this case

for a technique using comboboxes
http://www.mrexcel.com/board2/viewtopic.php?t=152281&start=5

see also this explanation
http://www.contextures.com/xlDataVal02.html

and
http://www.mrexcel.com/board2/viewtopic.php?t=15030&highlight=

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

subject of email
cascading comboboxes

kind regards,
Erik
 

Forum statistics

Threads
1,141,301
Messages
5,705,583
Members
421,400
Latest member
chakam

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
Top