'Searchable Combobox word vba
My Word userform combobox load items from Excel file, and the items shown fine, I need help with searching code in combobox change event
the searching code running fine in Excel, I think Word not support application.match any help..
Dim i As Long
Dim d As Object
With Me.ComboBox1
Set d = CreateObject("scripting.dictionary")
d.CompareMode = vbTextCompare
If Len(.Text) And IsError(Application.Match(.Text, va, 0)) Then
For i = 1 To UBound(va)
If InStr(1, " " & va(i), " " & .Text, vbTextCompare) Then d(va(i)) = Empty
Next
.List = d.keys
.DropDown
ElseIf Len(.Text) = 0 Then
.List = va
End If
End With
Crossed post LINK
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
