Dmitry_D_Onishchenko
New Member
- Joined
- Nov 27, 2019
- Messages
- 18
- Office Version
- 365
- 2013
- 2010
- Platform
- Windows
Hi MrExcel, I'll greatly appreciate your input re the issue below.
I'm looking for an option to add elements (such as ListBoxes) to a Userform in a dynamic/interactive way: the number of ListBoxes (as well as their names, tab indices etc.) should depend on a specific input value (say, on the number of selected items in a ListBox or on the item selected in a ComboBox). Thus, two questions arise.
1) In VBA, is there a way to dynamically add elements (such as ListBoxes) to the UserForm once the UserForm is initialized?
2) If no, what could be the best alternative option?
In case some context is needed:
I'm working on a solution to simultaneously filter multiple worksheets based on multiple criteria. A user may select from a ListBox an arbitrary number of fields to be used as filters. Then I want the corresponding number of ListBoxes to appear with the filter values themselves. Obviously, the number of ListBoxes needed is not known at the time when UserForm is initialized.
Thanks in advance,
Dmitry
I'm looking for an option to add elements (such as ListBoxes) to a Userform in a dynamic/interactive way: the number of ListBoxes (as well as their names, tab indices etc.) should depend on a specific input value (say, on the number of selected items in a ListBox or on the item selected in a ComboBox). Thus, two questions arise.
1) In VBA, is there a way to dynamically add elements (such as ListBoxes) to the UserForm once the UserForm is initialized?
2) If no, what could be the best alternative option?
In case some context is needed:
I'm working on a solution to simultaneously filter multiple worksheets based on multiple criteria. A user may select from a ListBox an arbitrary number of fields to be used as filters. Then I want the corresponding number of ListBoxes to appear with the filter values themselves. Obviously, the number of ListBoxes needed is not known at the time when UserForm is initialized.
Thanks in advance,
Dmitry