ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   combobox limit to list (https://www.excelbanter.com/excel-programming/335476-combobox-limit-list.html)

tmort[_5_]

combobox limit to list
 

I'd like to limit limit the choices in an Excel combobox to the tw
items in the list.

I can specify exact match, but users can still enter text and get a
error. What I'd like would be the equivalent to the limit to lis
proprty in Access.

I'll settle for some sort of error handler. I think it was error 380.
When I try to put an error handler on the before or after updat
property nothing happes.

I notice that the error message is labeled form so maybe it is a for
error, but, I don't see a form error event.

Thanks for any hel

--
tmor
-----------------------------------------------------------------------
tmort's Profile: http://www.excelforum.com/member.php...fo&userid=2105
View this thread: http://www.excelforum.com/showthread.php?threadid=38999


Tom Ogilvy

combobox limit to list
 
Combobox.Style = fmStyleDropDownList

from help on the style property for fmStyleDropDownList (2)

The ComboBox behaves as a list box. The user must choose a value from the
list.

--
Regards,
Tom Ogilvy


"tmort" wrote in
message ...

I'd like to limit limit the choices in an Excel combobox to the two
items in the list.

I can specify exact match, but users can still enter text and get an
error. What I'd like would be the equivalent to the limit to list
proprty in Access.

I'll settle for some sort of error handler. I think it was error 380.
When I try to put an error handler on the before or after update
property nothing happes.

I notice that the error message is labeled form so maybe it is a form
error, but, I don't see a form error event.

Thanks for any help


--
tmort
------------------------------------------------------------------------
tmort's Profile:

http://www.excelforum.com/member.php...o&userid=21053
View this thread: http://www.excelforum.com/showthread...hreadid=389992




STEVE BELL

combobox limit to list
 
You could add a check in your code that looks at the
combobox.value and checks to see if it is in the list.

If combobox1.value = 1 or combobox1.value = 2 then
' continue code
Else Msgbox "You did not make an acceptable selection. Please try again"
' code to restart the procedure
End If

--
steveB

Remove "AYN" from email to respond
"tmort" wrote in
message ...

I'd like to limit limit the choices in an Excel combobox to the two
items in the list.

I can specify exact match, but users can still enter text and get an
error. What I'd like would be the equivalent to the limit to list
proprty in Access.

I'll settle for some sort of error handler. I think it was error 380.
When I try to put an error handler on the before or after update
property nothing happes.

I notice that the error message is labeled form so maybe it is a form
error, but, I don't see a form error event.

Thanks for any help


--
tmort
------------------------------------------------------------------------
tmort's Profile:
http://www.excelforum.com/member.php...o&userid=21053
View this thread: http://www.excelforum.com/showthread...hreadid=389992




TommySzalapski[_6_]

combobox limit to list
 

Go to the properties of your combobox (right click and clic
"properties") and change the "Style" to "2 - fmStyleDropDownList

--
TommySzalapsk
-----------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...fo&userid=2556
View this thread: http://www.excelforum.com/showthread.php?threadid=38999


tmort[_7_]

combobox limit to list
 

Thanks,

Stype 2 works fine for my purposes but I'm glad to learn of the othe
check value method to

--
tmor
-----------------------------------------------------------------------
tmort's Profile: http://www.excelforum.com/member.php...fo&userid=2105
View this thread: http://www.excelforum.com/showthread.php?threadid=38999



All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com