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
 
Thanks, guys, for all your efforts. I'm still working on the problem. As most VBA programmers have experienced, sometimes your work gets refocused. I had to jump to another project temporarily.
I did come up with a way to get it done, but it's clunky. I've become obsessed with writing the shortest code possible to get the job done. The code sample you sent was great. I can tell it is more advanced than my limited knowledge, but I'm always open to new methods. It will take some study.
I'll get back to you.
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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