Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find an exact match and go to that match Heath Excel Discussion (Misc queries) 0 February 12th 09 02:28 AM
Find Exact Match using INDEX, MATCH DoubleUU Excel Worksheet Functions 3 August 15th 08 02:42 PM
If X = Y then (when it doesn't have to be an exact match) PaulW Excel Programming 3 August 22nd 07 01:08 PM
Match name not exact Samantha Excel Worksheet Functions 3 April 11th 06 01:12 PM
Getting an exact match Roland Excel Programming 1 January 25th 05 12:45 PM


All times are GMT +1. The time now is 11:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"