VBA Procedural Question

Mhat

Active Member
Joined
May 23, 2003
Messages
448
Hi All,

I am creating a userform with combo boxes that will contain names. The aircraft that the user selects will determine how many combo boxes are needed on the form (between 9 to 20). What is the best way to go about this? Should I create a form with 20 comboboxes and then hide the boxes and resize the form depending on the number of boxes needed or is there a better way?

Regards,

Mike
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
The only way I can think of is possibly create multiple userforms. The first with only the aircraft combo, and the appropriate userform is called based the users selection. This could turn out to be way more tedious than what you propose, though. Maybe just use an event handler based on the aircraft selected in Combo1 to adjust the properties (I use .Text, .Locked, .TabStop, & .BackStyle). You may be able to set up ranges in your workbook to cut down on the amount of code you'd actually have to write (ie Case 1 = fill Combo# with a specified range and Case 2 = set properties to disable unneeded Combos).

Warning: I'm a little new to VB, so I'd have to endure trial & error with it some as far as coming up with specific code and range setup.
 
Upvote 0
Thanks for your input, I wasn't sure if there was an established procedure for this kind of thing, I don't want to reinvent the wheel.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

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