combobox validation

llan_man

New Member
Joined
Nov 6, 2005
Messages
45
Hi

I have a combox on a userform which is linked to a range of cells. Depending on the value they pick, there is some code that does a vlookup on this value. However, I want to be able to restrict the user to only pick one of the items in the combo list. What I'm finding is that if I key in anything else into the combox, the vlookup fails (as you'd expect).

Any ideas?

Thanks

Harv
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Harv

Try changing the combobox matchrequired property to true and the matchentry to fmmatchentrycomplete.

It will allow you to enter other things, but it won't let you leave the box with a nonmatching entry.

HTH

Tony
 
Upvote 0
llan_man said:
However, I want to be able to restrict the user to only pick one of the items in the combo list.
In the ComboBox's properties window, find the "Style" property, and set it to "2 - fmStyleDropDownList". This will disable people from entering anything in the combobox field, and they will need to select an item from the drop-down method if they want to change the combobox value..
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top