Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Exact Match control
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Exact Match control
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 "Bishop" wrote: 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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Exact Match control
Add ComboBox1.ListIndex = 0 after adding Items..
-- If this post helps click Yes --------------- Jacob Skaria "Bishop" wrote: 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? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Exact Match control
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? "Patrick Molloy" wrote: 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 "Bishop" wrote: 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? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Exact Match control
of course yuo do :)
Private Sub UserForm_Initialize() ComboBox1.AddItem "A" ComboBox1.AddItem "B" ComboBox1.ListIndex = 0 End Sub "Bishop" wrote: 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? "Patrick Molloy" wrote: 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 "Bishop" wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find an exact match and go to that match | Excel Discussion (Misc queries) | |||
Find Exact Match using INDEX, MATCH | Excel Worksheet Functions | |||
If X = Y then (when it doesn't have to be an exact match) | Excel Programming | |||
Match name not exact | Excel Worksheet Functions | |||
Getting an exact match | Excel Programming |