View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Finding duplicates in list during UserForm entry process

with worksheets("sheet1")
if application.countif(.range("e:e"),mypovariable) 0 then
msgbox "already there
else
'ok to add
end if
end with

is one way.

excelnut1954 wrote:

I'm designing a userform to be usee to add new records to a worksheet.

The user enters will enter the PO# in the userform in the 1st box. What
I would like to know, is there any coding I can include that will cause
that PO# entered by the user to be matched against all the PO numbers
already on the list? If so, I'll have a message box come up, telling
the user how to handle the duplicate.

Ideally, before the user goes on to the 2nd box in the userform, I
would like the check to be made if there is a duplicate.

The range name of the header for the PO number column is
"PO_OfficialList".

I'm sure this would work better if we were maintaining this list in
Access, but that isn't possible here at this time. I'm the only person
here in this dept that has Access.

So, can what I described be done with VBA coding?

Thanks,
J.O.


--

Dave Peterson