Paul van de Laar
New Member
- Joined
- May 26, 2011
- Messages
- 1
Hello All,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I have a userform with 22 labels and 22 comboboxen and 22 textboxen.<o></o>
Start with label1 till label22 <o></o>
Next to the label are 1 combobox and 1 textbox they cover each other. Also 1 till 22<o></o>
<o> </o>
The data for the labels captions are in my sheet on one row and 22 kolomn’s<o></o>
<o> </o>
If in the kolom in the rows below the row with the label captions is filled with text then <o></o>
the combobox is visible=true and the textbox visible =false<o></o>
If the rows below the row with the lable caption are empty then the textbox visible = true and the combobox visible=false<o></o>
<o> </o>
I want to fill the labels and the combobox with a for next loop<o></o>
Something like this<o></o>
<o> </o>
For x = 1 to 22<o></o>
<o> </o>
Userform1.Label & x = cells(1,x)<o></o>
If cells(2,x)>”” then <o></o>
Userform1.ComboBox & x.visible=true<o></o>
Userform1.TextBox & x.visible=false<o></o>
Userform1.combobox & x.RowSource=address van range cells(2,x) till cells(25,x)<o></o>
else<o></o>
Userform1.textbox & x.visible=true<o></o>
Userform1.ComboBox & x.visible=False<o></o>
<o> </o>
Next x<o></o>
<o> </o>
this peace off code will never work like this.<o></o>
<o> </o>
Question:<o></o>
Is it possible to use Label & x to fill Label1 till Label22<o></o>
Is it possible to use ComboBox & x to fill the rowsource<o></o>
Thanks
Paul
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I have a userform with 22 labels and 22 comboboxen and 22 textboxen.<o></o>
Start with label1 till label22 <o></o>
Next to the label are 1 combobox and 1 textbox they cover each other. Also 1 till 22<o></o>
<o> </o>
The data for the labels captions are in my sheet on one row and 22 kolomn’s<o></o>
<o> </o>
If in the kolom in the rows below the row with the label captions is filled with text then <o></o>
the combobox is visible=true and the textbox visible =false<o></o>
If the rows below the row with the lable caption are empty then the textbox visible = true and the combobox visible=false<o></o>
<o> </o>
I want to fill the labels and the combobox with a for next loop<o></o>
Something like this<o></o>
<o> </o>
For x = 1 to 22<o></o>
<o> </o>
Userform1.Label & x = cells(1,x)<o></o>
If cells(2,x)>”” then <o></o>
Userform1.ComboBox & x.visible=true<o></o>
Userform1.TextBox & x.visible=false<o></o>
Userform1.combobox & x.RowSource=address van range cells(2,x) till cells(25,x)<o></o>
else<o></o>
Userform1.textbox & x.visible=true<o></o>
Userform1.ComboBox & x.visible=False<o></o>
<o> </o>
Next x<o></o>
<o> </o>
this peace off code will never work like this.<o></o>
<o> </o>
Question:<o></o>
Is it possible to use Label & x to fill Label1 till Label22<o></o>
Is it possible to use ComboBox & x to fill the rowsource<o></o>
Thanks
Paul