Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Combo Box mandatory selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vindaloo - 20 Mar 2006 18:14 GMT
Hi,

I have a Combo Box (added through the Control Toolbox) that I want t
be mandatory, i.e. it must always contain one of the values reference
in the ListFillRange.  Currently I can select one of the values, but
can then overtype it with something else not in the list, or remove i
completely.  

What is the best way to achieve this?  I can do it easily using a Comb
Box from the Forms toolbar but I want to do some additional processin
on selection of a valid entry so I really need the Combo_Chang
subroutine.

To give a better idea of the overall picture, imagine a spreadshee
that has the Combo Box with values "Price List A" and "Price List B".
According to this selection, a named range will be amended using:

Code
-------------------
   If Combo.Value = "A" Then
 ActiveWorkbook.Names("pricelist").RefersTo = "=prices!$A$1:$B$10"
 ElseIf Combo.Value = "B" Then
 ActiveWorkbook.Names("pricelist").RefersTo = "=prices!$D$1:$E$10"
 End If

-------------------

All subsequent lookup functions in the sheets can then use this name
range to look up the correct values.

What I want to avoid is the user typing in a random value or a blan
that the above code can't handle (ignoring for the moment the use of
catch-all Else at the end)

Thanks in advance,
Vindalo
Tom Ogilvy - 20 Mar 2006 18:45 GMT
change properties

matchentry      FmMatchEntryNone
style               fmStyleDropDownList

then the user must select from the list.

Signature

Regards,
Tom Ogilvy

> Hi,
>
[quoted text clipped - 32 lines]
> Thanks in advance,
> Vindaloo
Vindaloo - 20 Mar 2006 20:50 GMT
Thanks very much Tom.  Next time I'll have a proper look through th
properties! :)

Regards,
Vindalo
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.