View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default More Listbox help..

A dropped 0?

If Not Iserror(application.match(userform2.listbox1.value , range("A1:A20"), 0)




Bob Phillips wrote:

You either have to loop through every item checking to see whether it is
used in the combo, or if the combo is linked to a worksheet range, you could
use MATCH to check it

If Not Iserror(application.match(userform2.listbox1.value , range("A1:A20"))
then
msgbox "im sorry you've entered duplicate charges"
etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)

"justchris" wrote
in message ...

I'm wondering how I can Check for duplicates in a listbox. The listbox
is filled with values from a combobox and has numbers 1000 -8000. I
need to say ok, You've already entered a value for 1000 please check
the posting code and try again.


I was trying something like


Code:
--------------------
if userform2.listbox1.value = userform2.combobox1.value then
msgbox "im sorry you've entered duplicate charges"
else
with userform2.listbox1
.additem userform2.combobox1.value
end with
--------------------


Its a little more complicated then that but this is just a relative
idea of what im trying to do.

Thanks in advance...
Chris


--
justchris
------------------------------------------------------------------------
justchris's Profile:

http://www.excelforum.com/member.php...fo&userid=8894
View this thread: http://www.excelforum.com/showthread...hreadid=401393


--

Dave Peterson