Attach your file so we can see your user form

Searching through listbox while typing into textbox
- KjBox
- Thread is marked as Resolved.
-
-
-
Hi rharri1972. I'm not real sure about your needs for double clicking and/or selecting a select button? If you want to select the part number in the listbox as U type, it seems the following code will work. You will need to adjust the sheet name and range to where your part numbers are located. U need a userform1 that has a listbox1 and a textbox1 on it. HTH. Dave
Userform code...
Code
Display MoreDim Arr As Variant Private Sub UserForm_Initialize() '***change sheet name and range to suit Arr = Sheets("sheet1").Range("A1:A10") With UserForm1.ListBox1 .List = Arr End With End Sub Private Sub TextBox1_Change() Dim Cnt As Integer, Cnt2 As Integer UserForm1.ListBox1.ListIndex = -1 For Cnt = 1 To Len(UserForm1.TextBox1.Text) For Cnt2 = LBound(Arr) To UBound(Arr) If Left(Arr(Cnt2, 1), Cnt) = UserForm1.TextBox1.Text Then UserForm1.ListBox1.ListIndex = Cnt2 - 1 Exit Sub End If Next Cnt2 Next Cnt End Sub
-
Hmmmmm? Request for assistance post deleted by a moderator (at the request of the poster) after a solution was posted (without acknowledgement of the assistance provided) or any comment as to why the query was deleted? Most unusual. I'll return to volunteering my time at other sites. Dave
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!