Entering text in combobox using vba

  • Thread starter Thread starter franky
  • Start date Start date
F

franky

Hello,

I have vba code that puts some text into a combobox. Is it possibe to have
the combobox auto fill the rest on the text just like how it normally works
when you are typing from the keyboard?

Thanks in advance!
 
franky said:
I have vba code that puts some text into a combobox. Is it possibe to have
the combobox auto fill the rest on the text just like how it normally works
when you are typing from the keyboard?


Not "just like" when typing, but this code gets pretty
close:

Private Sub cboName_Enter()
Dim k As Integer

With Me.cboName
For k = 0 To .ListCount - 1
If .Column(1, k) Like "sometext*" Then
.ListIndex = k
Exit For
End If
Next k
.Dropdown
End With

End Sub
 
Back
Top