Tourtelot
Tourtelot

Reputation: 137

Excel Data Validation Combo Box: Limit options to named range

Thanks in advance for your help.

I have created a simple VBA form in Excel. In that form I have created a combo box. To populate this combo box I created a named range and inserted that into the row source field.

Good news: The field populates and I can use the autocomplete features of combo box.

Bad news: I cannot restrict what the user types into the box. Ex. if Dog, Cat, Frog are the options in the named range -- I cant stop a user from entering T-Rex and submitting the form to the DB.

Is there an easy fix?

Upvotes: 0

Views: 784

Answers (1)

Tourtelot
Tourtelot

Reputation: 137

Setting the Style property to DropDownList does solve the problem, but limits the users ability to type in the cell.

Setting the MatchRequired to true allows the combo box to function as normal but limits the entry to the defined range.

Upvotes: 0

Related Questions