Hi everyone,
I'm currently in the process of getting the workings right for a trailer movement userform that I've had an idea about.
I've got the stage where the form changes when searching but i can't figure out how to populate the columns with the array (Within the listbox - it has 16 columns) Currently it just shows 1 column
So if you search BAY117 - it will list 3 of them (which is correct) Each one has different data, that is saved with the array but i'm not sure how i go about listing that data next to each data entry
Any help on this would be great
Thanks in advance!
EDIT:
Also posted here VBA Live search box in userform with listbox
I'm currently in the process of getting the workings right for a trailer movement userform that I've had an idea about.
I've got the stage where the form changes when searching but i can't figure out how to populate the columns with the array (Within the listbox - it has 16 columns) Currently it just shows 1 column
VBA Code:
Private Sub TextBox14_Change()
Dim i As Long
Dim arrList As Variant
ListBox1.RowSource = ""
If Sheet1.Range("A" & Sheet1.Rows.Count).End(xlUp).Row > 1 And Trim(Me.TextBox14.Value) <> vbNullString Then
arrList = Sheet1.Range("A2:Q" & Sheet1.Range("B" & Sheet1.Rows.Count).End(xlUp).Row).Value2
For i = LBound(arrList) To UBound(arrList)
If InStr(1, arrList(i, 1), Trim(Me.TextBox14.Value), vbTextCompare) Then
Me.ListBox1.AddItem arrList(i, 1)
End If
Next i
End If
If Me.ListBox1.ListCount = 1 Then Me.ListBox1.Selected(0) = True
End Sub
Any help on this would be great
Thanks in advance!
EDIT:
Also posted here VBA Live search box in userform with listbox
Last edited by a moderator: