Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Combobox list validation


I have a combobox with a list assigned with

For X = 16 To 30
ComboBox1.AddItem Sheets("Staff").Cells(1, X).Value
Next

but if user type something different it will take it

How do I force it to take only values from the preloaded list?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combobox list validation


Alberto Ast;607391 Wrote:
I have a combobox with a list assigned with

For X = 16 To 30
ComboBox1.AddItem Sheets("Staff").Cells(1, X).Value
Next

but if user type something different it will take it

How do I force it to take only values from the preloaded list?


Set its MatchRequired property to true. At run time by:
ComboBox1.MatchRequired = True
or at design time in the Properties pane for the combobox.


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: 558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=168491

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Combobox list validation

Thanks... it works but before I rate this post I have a question
what is the difference among below two options?

MatchRequired = true
or
Style = fmStyleDropDownList

"p45cal" wrote:


Alberto Ast;607391 Wrote:
I have a combobox with a list assigned with

For X = 16 To 30
ComboBox1.AddItem Sheets("Staff").Cells(1, X).Value
Next

but if user type something different it will take it

How do I force it to take only values from the preloaded list?


Set its MatchRequired property to true. At run time by:
ComboBox1.MatchRequired = True
or at design time in the Properties pane for the combobox.


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: 558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=168491

Microsoft Office Help

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combobox list validation


From the help file regarding Style:
fmStyleDropDownCombo: The ComboBox behaves as a drop-down combo box.
The user can type a value in the edit region or select a value from the
drop-down list (default).
fmStyleDropDownList: The ComboBox behaves as a list box. The user must
choose a value from the list.

regarding MatchRequired:
True: The text entered must match an existing list entry.
False: The text entered can be different from all existing list entries
(default).

So it would seem that you don't require Matchrequired=true if Style is
fmStyleDropDownList.


Alberto Ast;609270 Wrote:
Thanks... it works but before I rate this post I have a question
what is the difference between below two options?

MatchRequired = true
and
Style = fmStyleDropDownList

"p45cal" wrote:


Alberto Ast;607391 Wrote:
I have a combobox with a list assigned with

For X = 16 To 30
ComboBox1.AddItem Sheets("Staff").Cells(1, X).Value
Next

but if user type something different it will take it

How do I force it to take only values from the preloaded list?


Set its MatchRequired property to true. At run time by:
ComboBox1.MatchRequired = True
or at design time in the Properties pane for the combobox.


--
p45cal

*p45cal*

------------------------------------------------------------------------
p45cal's Profile: 558
View this thread: 'Combobox list validation - The Code Cage Forums'

(http://www.thecodecage.com/forumz/sh...d.php?t=168491)

'Microsoft Office Help' (http://www.thecodecage.com)

.



--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: 558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=168491

Microsoft Office Help

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
Data validation list, combobox CousinExcel Excel Discussion (Misc queries) 0 April 9th 10 11:38 AM
Combobox List to list Numerical Values ONLY in Column A is specific Sheet.... Corey Excel Programming 5 December 28th 06 10:40 AM
duplicates in validation list combobox chelle Excel Discussion (Misc queries) 1 December 7th 06 05:52 PM
ComboBox in a Data Validation List... Bob Barnes Excel Discussion (Misc queries) 3 January 6th 06 11:04 PM
ComboBox list reliant on the entry from a different ComboBox ndm berry[_2_] Excel Programming 4 October 4th 05 04:40 PM


All times are GMT +1. The time now is 12:47 PM.

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

About Us

"It's about Microsoft Excel"