Search code examples
exceluserformvba

How to prevent the auto complete of a UserForm ComboBox?


When I'm typing in a ComboBox in an Excel UserForm, for example I have a list item called SHEEP (all uppercase), then if I want to add another item called Shear (only the first letter is uppercase), the program will force it to look like this: SHEar

I do not want to disable the auto completing feature though, just not overwrite the upper/lower case typed by the keyboard.

The combo books is as shown below: Userform


Solution

  • I think the only way to prevent this is to disable matching of the entries. Therefore you need to set the MatchEntry Property of the ComboBox.

    In the Properties window change the MatchEntry property to 2 - fmMatchEntryNone.

    Alternatively you can use a TextBox to add a new entry into the ComboBox.