Consulting

Results 1 to 2 of 2

Thread: Filter combo box values as you type in

  1. #1
    VBAX Regular
    Joined
    Apr 2018
    Location
    MUMBAI
    Posts
    13
    Location

    Filter combo box values as you type in

    Hello,

    I have an excel userform where i have a dropdown which has all the name of user from user table of access database.

    I am looking for something where user can type in and each letter entered should filter the dorpdown values of the combobox.

    Any help would be highly a[ppreciated.

    Thanks
    Nkpan

  2. #2
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    try this:
    Code was posted here - http://dailydoseofexcel.com/archives...lete/#comments
    Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
     ' prevent dropdown list appearing and cycling thru list
        If KeyCode = vbKeyDown Then
            KeyCode = 0
        ElseIf KeyCode = vbKeyUp Then
            KeyCode = 0
        End If
     
    End Sub
     
    Private Sub UserForm_Initialize()
        
        With ComboBox1
            .ShowDropButtonWhen = fmShowDropButtonWhenNever
            .AddItem "John Here"
            .AddItem "Jonn There"
            .AddItem "Donna Here"
            .AddItem "Logan There"
            .AddItem "Ethan Everywhere"
        End With
            
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •