Excel VBA ComBox Box with AutoComplete Search - Excel VBA Searchable Combox - Code Included
This Excel VBA example explains how to create searchable ComboBox with autocomplete feature.
you can get the relevant items as soon as you type in ComboBox and it autocomplete entries basis on matches.
Code is as follows :
Option Explicit
Private Comb_Arrow As Boolean
Private Sub ComboBox1_Change()
Dim i As Long
If Not Comb_Arrow Then
With Me.ComboBox1
.List = Worksheets("Data").Range("A2", Worksheets("Data").Cells(Rows.Count, "A").End(xlUp)).Value
.ListRows = Application.WorksheetFunction.Min(4, .ListCount)
.DropDown
If Len(.Text) Then
For i = .ListCount - 1 To 0 Step -1
If InStr(1, .List(i), .Text, vbTextCompare) = 0 Then .RemoveItem i
Next
.DropDown
End If
End With
End If
End Sub
Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Comb_Arrow = (KeyCode = vbKeyUp) Or (KeyCode = vbKeyDown)
If KeyCode = vbKeyReturn Then Me.ComboBox1.List = Worksheets("Data").Range _
("A2", Worksheets("Data").Cells(Rows.Count, "A").End(xlUp)).Value
End Sub
Видео Excel VBA ComBox Box with AutoComplete Search - Excel VBA Searchable Combox - Code Included канала Excel Destination
you can get the relevant items as soon as you type in ComboBox and it autocomplete entries basis on matches.
Code is as follows :
Option Explicit
Private Comb_Arrow As Boolean
Private Sub ComboBox1_Change()
Dim i As Long
If Not Comb_Arrow Then
With Me.ComboBox1
.List = Worksheets("Data").Range("A2", Worksheets("Data").Cells(Rows.Count, "A").End(xlUp)).Value
.ListRows = Application.WorksheetFunction.Min(4, .ListCount)
.DropDown
If Len(.Text) Then
For i = .ListCount - 1 To 0 Step -1
If InStr(1, .List(i), .Text, vbTextCompare) = 0 Then .RemoveItem i
Next
.DropDown
End If
End With
End If
End Sub
Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Comb_Arrow = (KeyCode = vbKeyUp) Or (KeyCode = vbKeyDown)
If KeyCode = vbKeyReturn Then Me.ComboBox1.List = Worksheets("Data").Range _
("A2", Worksheets("Data").Cells(Rows.Count, "A").End(xlUp)).Value
End Sub
Видео Excel VBA ComBox Box with AutoComplete Search - Excel VBA Searchable Combox - Code Included канала Excel Destination
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Searchable Dropdown for VBA UserForms(Add in 30 Seconds)Excel ActiveX Combo Box to Select Worksheets with VBACreate a Filter as You Type SEARCH BOX in Excel VBACreate a Searchable Drop Down List Just Like Google - Excel TrickAutocomplete Entries With Excel Drop Down ListFully Automated Data Entry User Form in Excel - Step By Step TutorialSearchable Drop Down List in Excel (Very Easy with FILTER Function)Searchable Combobox Excel VBAHow to Create a Dynamic Searchable Drop Down List in ExcelSearchable drop-down list for multiple cellsSEARCHABLE Drop-Down Lists in Excel (without VBA)How to create a Dynamic Search Suggestion Drop Down List in ExcelListBox Search Crieria Match Every Spell Excel VBAPopulate ListBox based on Textbox Keywords || Display search results in listbox while typing..Universal Searchable Drop-down List in ExcelExcel Autocomplete And Suggestions From ListVBA Code to Extract Text Between two Strings - Macro for Text Mining in Simple StepsSearchable Drop-Down List in Excel - The Easy WayCompare Data in Two Excel Sheets - Compare Two Worksheets Quickly