J
jayklmno
I am using a keyword to filer an existsing array. As I come across data that
fits the filter, I want to add that array record to the listbox. It is a 7
column listbox. I cannot get the add to work.
SortKey = combobox1.Value
listbox1.Clear
With listbox1
.ColumnCount = 7
.ColumnWidths = "35;70;160;75;60;60"
ReDim lVar(1, 7)
For X = 1 To UBound(tempData)
If tempData(X, 29) = SortKey Then
lVar(1, 1) = tempData(X, 28)
lVar(1, 2) = tempData(X, 22)
lVar(1, 3) = tempData(X, 2)
lVar(1, 4) = tempData(X, 21)'
lVar(1, 5) = Format(tempData(X, 27), "MM/DD/YY")
lVar(1, 6) = tempData(X, 18)
lVar(1, 7) = tempData(X, 29)
listbox1.additem = lVar
End If
Next X
End With
No matter how I phrase the add item line, it will not add the record to the
listbox. What is the correct code for this? I want the new data found to be
appended to the existing data as it loops through the tempData array.
fits the filter, I want to add that array record to the listbox. It is a 7
column listbox. I cannot get the add to work.
SortKey = combobox1.Value
listbox1.Clear
With listbox1
.ColumnCount = 7
.ColumnWidths = "35;70;160;75;60;60"
ReDim lVar(1, 7)
For X = 1 To UBound(tempData)
If tempData(X, 29) = SortKey Then
lVar(1, 1) = tempData(X, 28)
lVar(1, 2) = tempData(X, 22)
lVar(1, 3) = tempData(X, 2)
lVar(1, 4) = tempData(X, 21)'
lVar(1, 5) = Format(tempData(X, 27), "MM/DD/YY")
lVar(1, 6) = tempData(X, 18)
lVar(1, 7) = tempData(X, 29)
listbox1.additem = lVar
End If
Next X
End With
No matter how I phrase the add item line, it will not add the record to the
listbox. What is the correct code for this? I want the new data found to be
appended to the existing data as it loops through the tempData array.