MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question
Filter specific column in listbox
Hi Good People, Hoping someone could actually me on this problem. So basically, I have a textbox and a Listbox thats filter via textbox value. However, I…
Hoping someone could actually me on this problem. So basically, I have a textbox and a Listbox thats filter via textbox value. However, I wanted to show only a specific column of my listbox.
Below code filters my listbox.
My search starts in a2, if textbox value match the value in column A of my Sheet, then it shows all the items in listbox based on textbox value.
What I wanted to achieve is to show only lets say column B and column C only..
My textbox value will search in column A and display column B and C data to the listbox related to column A.
Is that possible? Thank you
Private Sub TextBox1_Change() Dim a, i As Long, ii As Long, n As Long, temp As String If Len(Me.TextBox1.Value) Then temp = UCase(Me.TextBox1.Value) With Sheets("sheet1") a = .Range("a2", .Range("a" & Rows.Count).End(xlUp)) _ .Resize(, 2).Value End With a = Application.Transpose(a) For i = 1 To UBound(a, 2) If UCase(a(1, i)) Like temp & "*" Or _ UCase(a(2, i)) Like temp & "*" Then n = n + 1 For ii = 1 To UBound(a, 1) a(ii, n) = a(ii, i) Next End If Next If n > 0 Then ReDim Preserve a(1 To UBound(a, 1), 1 To n) Me.ListBox1.Column = a End If End If End Sub