Hi:
I have created a list box in Excel VBA using the following code:
****************************
Private Sub UserForm_Initialize()
Dim RC, RC2 As Integer
'Selects the "Draft Sheet" worksheet
Sheet1.Select
Range("D2").Select
RC = 2
Set menusheet = ThisWorkbook.Sheets("Draft Sheet")
With ListBox1
Do Until IsEmpty(menusheet.Cells(RC, 4))
If menusheet.Cells(RC, 10) = "" Then
.AddItem menusheet.Cells(RC, 4)
End If
RC = RC + 1
Loop
End With
End Sub
****************************
What I'd like to do now is use the TextBox1 to be able to type a name and have it search the ListBox1 while simultaneously removing all the other ListBox1 items that do not match what I am typing. I have seen some similar posts on this topic but could not quite understand them.
Thanks,
Matt
I have created a list box in Excel VBA using the following code:
****************************
Private Sub UserForm_Initialize()
Dim RC, RC2 As Integer
'Selects the "Draft Sheet" worksheet
Sheet1.Select
Range("D2").Select
RC = 2
Set menusheet = ThisWorkbook.Sheets("Draft Sheet")
With ListBox1
Do Until IsEmpty(menusheet.Cells(RC, 4))
If menusheet.Cells(RC, 10) = "" Then
.AddItem menusheet.Cells(RC, 4)
End If
RC = RC + 1
Loop
End With
End Sub
****************************
What I'd like to do now is use the TextBox1 to be able to type a name and have it search the ListBox1 while simultaneously removing all the other ListBox1 items that do not match what I am typing. I have seen some similar posts on this topic but could not quite understand them.
Thanks,
Matt