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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

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
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
item limit for a combobox? KarenH Excel Worksheet Functions 3 July 20th 06 09:30 PM
Drop down list limit to list Dropdown3 Excel Discussion (Misc queries) 4 March 3rd 06 09:54 PM
adding items to combobox using "Tag" control to limit bob cochran Excel Programming 5 September 10th 03 05:21 PM
ComboBox List steve Excel Programming 0 August 26th 03 04:59 PM


All times are GMT +1. The time now is 03: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"