I'm trying to use the solution given to this issue : Programmatically create event listener in VBA in my particular case :
I programmatically create comboboxes. What I would like to do is to programmatically create a single textbox with a precise label or several texboxes with as many labels next to the generated comboboxes depending on their values.
Here is the code I use to programmatically create those comboboxes :
Set listBoxB1 = Frame1.Controls.Add("Forms.ComboBox.1")
With listBoxB1
.Name = "list" & i
.Height = 15
.Width = 100
.Left = 70
.Top = 10 * i * 3
.AddItem "NUM"
.AddItem "LIST"
End With
So I want that when the user choses the value LIST, a single textbox is displayed next to the combobox with a label and when he or she uses the value NUM, 6 textboxes are created next to the combobox and aligned with it horizontally.
I actually want that the display changes automatically when the user changes the value of the combobox, it would be helpful if you can give some indications about that.
Can you please tell me how I can adapt the solution in the link above to my case, because I'm very new to VBA and don't exactly know how to do that, I have tried to implement the code given but failed.