I have a listbox that I populate with rowsource from a table called table1.
I am trying to only load values that are bigger then 0 and not negative in the listbox.
I am trying to select which column that is bigger then 0 and not negative.
Ex.
I want to load only values in the multiple column listbox for all values in column D that are greater then 0.
So if row5 in the rowsource is 0 then row 5 won't get loaded into the listbox etc. for all rows.
This is the code I have right now:
How can I do this?
I am trying to only load values that are bigger then 0 and not negative in the listbox.
I am trying to select which column that is bigger then 0 and not negative.
Ex.
I want to load only values in the multiple column listbox for all values in column D that are greater then 0.
So if row5 in the rowsource is 0 then row 5 won't get loaded into the listbox etc. for all rows.
This is the code I have right now:
Code:
Private Sub CommandButton11_Click()
Dim lastrow As Integer
Dim X As Integer
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
lastrow = ws.Cells(Rows.Count, 1).End(xlUp).Row
For X = 2 To lastrow
' Column D
If ws.Cells(X, 4) > 0 or ws.cells(X,4) <> "0" Then
'''''''''''''''''''
''' Do something here to update the rowsource???
End If
End Sub
How can I do this?