Combobox Exact Match control

B

Bishop

I have a combobox in a userform that has say 10 list items. When the
userform pops up the combobox is initially empty. I can then enter any of
the 10 list items in the box. The problem is it will also let me choose
nothing... just leave it blank. How can I change it so that one of the 10
list items HAS to be selected so you can't just leave it blank?
 
P

Patrick Molloy

you can set the listindex to 0 (zero) which is like selecting the first item
alternatively set the combobox TEXT value to an item in the list
 
B

Bishop

I don't have a listindex option under properties. I do have the following
though:

listrows set to 8
liststyle set to 0
listwidth set to 0
tabindex set to 1
topindex set to -1

Should I be looking somewhere else?
 
P

Patrick Molloy

of course yuo do :)

Private Sub UserForm_Initialize()
ComboBox1.AddItem "A"
ComboBox1.AddItem "B"
ComboBox1.ListIndex = 0
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top