View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Checks for duplicate entries

Dim cnt as Long
cnt = Application.Countif(Range("Database"),Trim(useform 1.Textbox1.Text))
If cnt 0 then
ans = msgbox ("You have " & cnt & " number of matching invoice
numbers",vbYesNo)

--
Regards,
Tom Ogilvy

"Jennifer" wrote in message
...
Hi there,
I have been searching the site and am not finding just a basic code that:
Looks at the invoice number being entered in the userform it then looks
through a range named "database" looking specifically in column "A" for

the
number of matches and simply prompts a messages box saying "You have XX
number of matching invoice numbers do you still want to continue Yes/No"

Thank you for your help.
--
Though daily learning, I LOVE EXCEL!
Jennifer