(Solved) – Partial String Match (How to match any part of a string while I type in a combobox?)

(solved)-–-partial-string-match-(how-to-match-any-part-of-a-string-while-i-type-in-a-combobox?)

What I have:

[Form: “Intajform”] – [Combobox: “CustomerName_Combobox”] – [Initialize Event: Load list]

Private Sub UserForm_Initialize()
Dim ws As Worksheet, rCell, srr As Range, Key
Dim Dic As Object: Set Dic = CreateObject("Scripting.Dictionary")
Set ws = ThisWorkbook.Worksheets("Backend")
Set srr = ws.Range("b2", ws.Cells(Rows.Count, "b").End(xlUp))
For Each rCell In srr
If Not Dic.exists(rCell.Value) Then
Dic.Add (rCell.Value), Nothing
End If
Next rCell
For Each Key In Dic
IntajForm.CustomerName_Combobox.AddItem Key
Next
End Sub

While typing in that combobox to find a match

I CAN FULLY MATCH STRINGS BY FIRST LETTER ONLY
EX: If I type “M” then I find “Microsoft Corporation”

BUT I CAN NOT PARTIALLY MATCH STRINGS
EX: If I type “r” then it is blank ” “

Summary
I want to partially match the string found in Combobox as long as the letter I type is found in the string

Leave a Reply

Your email address will not be published. Required fields are marked *