Assuming lowercase:
Option Explicit
Dim h() As String
Private Sub Search1_Change()
Dim temp, temp2, i As Long
temp = Filter(h, LCase(Me.Search1.Text))
If UBound(temp) <> -1 Then
ReDim temp2(UBound(temp))
For i = LBound(temp) To UBound(temp)
temp2(i) = Split(temp(i), vbCrLf)(UBound(Split(temp(i), vbCrLf)))
Next i
Me.LboSearch.List = temp2
Else
Me.LboSearch.Clear
End If
End Sub
Private Sub UserForm_Initialize()
Dim g() As Variant
Dim i As Long, j As Long
g = Sheet1.ListObjects("contact").Range.Value
ReDim h(LBound(g) To UBound(g) - 1)
For i = LBound(g) To UBound(g) - 1
For j = LBound(g, 2) To UBound(g, 2)
h(i) = h(i) & vbCrLf & LCase(g(i + 1, j))
Next j
Next i
End Sub
It stops being perfectly smooth at around 10k rows on my machine, but it's still very useable - I've tested it up to 30k rows
Bookmarks