Hellow to everyone.
Please help me.
I have this Range("A2:D4") with fruits and quantity
To load this Range in a Listbox Userform i use this code
Private Sub UserForm_Initialize()
ListBox1.RowSource = Sheets("Sheet1").Range("A2:D4").Address
End Sub
I want to know which is the vba code to put in this ListBox only the products with the quantity greater than 0 ( qant > 0 ) ?
Thank's a lot.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Row/Coll[/TD]
[TD]A[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product[/TD]
[TD]Quantity[/TD]
[TD]unit[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Apples[/TD]
[TD]20[/TD]
[TD]kg[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Oranges[/TD]
[TD]0[/TD]
[TD]kg[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Bananas[/TD]
[TD]25[/TD]
[TD]kg[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Please help me.
I have this Range("A2:D4") with fruits and quantity
To load this Range in a Listbox Userform i use this code
Private Sub UserForm_Initialize()
ListBox1.RowSource = Sheets("Sheet1").Range("A2:D4").Address
End Sub
I want to know which is the vba code to put in this ListBox only the products with the quantity greater than 0 ( qant > 0 ) ?
Thank's a lot.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Row/Coll[/TD]
[TD]A[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product[/TD]
[TD]Quantity[/TD]
[TD]unit[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Apples[/TD]
[TD]20[/TD]
[TD]kg[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Oranges[/TD]
[TD]0[/TD]
[TD]kg[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Bananas[/TD]
[TD]25[/TD]
[TD]kg[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]