Skip to content

Instantly share code, notes, and snippets.

@TGDUY
Created May 21, 2018 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TGDUY/51b6f1a77ec715dbbbdc88733ffad10a to your computer and use it in GitHub Desktop.
Save TGDUY/51b6f1a77ec715dbbbdc88733ffad10a to your computer and use it in GitHub Desktop.
Option Explicit
Private DMHH As Variant
Private Sub CB_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Dim TMP As Variant
If KeyAscii = 32 Then
TMP = FindInArray(Trim(CB.Text), DMHH)
If Not IsEmpty(TMP) Then
CB.List = TMP
CB.DropDown
Else
CB.Clear
End If
End If
End Sub
Private Sub UserForm_Initialize()
DMHH = S1.Range("A2:C" & S1.Cells(S1.Rows.Count, "A").End(xlUp).Row).Value2
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment