Add a listbox to the userform, set it's ColumnCount to 3 and add this code to the userform module.
Private Sub TextBox1_Change()
Dim rngNames As Range
Dim arrNames
Dim arrResults
Dim lngRow As Long
If TextBox1.Value = "" Then
ListBox1.Clear
Exit Sub
End If
With Sheets("Sheet1")
Set rngNames = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
End With
With rngNames
arrNames = Evaluate(.Address & "&CHAR(45)&ROW(" & .Address & ")")
End With
arrNames = Application.Transpose(arrNames)
arrResults = Filter(arrNames, TextBox1.Value)
ListBox1.Clear
If UBound(arrResults) = -1 Then
ListBox1.AddItem "No matches"
Else
For i = LBound(arrResults) To UBound(arrResults)
lngRow = Mid(arrResults(i), InStrRev(arrResults(i), "-") + 1)
With ListBox1
.AddItem
.List(.ListCount - 1, 0) = Sheets("Sheet1").Range("A" & lngRow)
.List(.ListCount - 1, 1) = Sheets("Sheet1").Range("B" & lngRow)
.List(.ListCount - 1, 2) = Sheets("Sheet1").Range("C" & lngRow)
End With
Next i
End If
End Sub
Bookmarks