Userform force sequence

brianfosterblack

Active Member
Joined
Nov 1, 2011
Messages
251
I have a problem in my userform that my selection in listbox2 determines if listbox3 or listbox4 becomes visible. However if after listbox1 I click on listbox3 or 4 (whichever is visible) I get an error in my code because I should have selected in listbox 2 which listbox is actually visible.
Can I remove any selection accidently made in listbox3 or 4 and force setfocus onto listbox2 first when I click off listbox1 or can I in the userform code, force that all 6 listboxes must be selected in order 1 to 6 with the option that either listbox3 or listbox4 will be hidden depending on my selection in listbox 2
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
in the code for LIstbox2 you can select the visibility of the other listboxes - and in the initiating code you can hide any which are not immediately valid.

HTH
 
Upvote 0
Solution
hide all but the first listbox. then show them as you intend them to be used. you can even have the previous ones disabled but with selections showing and include a back button which then controls all the user behavior. a bit more work but "dumbproof" in the long run
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

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