Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Checks for duplicate entries

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Checks for duplicate entries

Hey Tom,
Thanks! What would the code be if the person answers "No" for it to Exit Sub?

I think that'll do it. Thank you again.
--
Though daily learning, I LOVE EXCEL!
Jennifer


"Tom Ogilvy" wrote:

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Checks for duplicate entries

Yeah for me I answered my own question. I'm learning though it may be at a
turtles pace:)
--
Though daily learning, I LOVE EXCEL!
Jennifer


"Jennifer" wrote:

Hey Tom,
Thanks! What would the code be if the person answers "No" for it to Exit Sub?

I think that'll do it. Thank you again.
--
Though daily learning, I LOVE EXCEL!
Jennifer


"Tom Ogilvy" wrote:

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




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
Duplicate entries nackgr Excel Discussion (Misc queries) 1 January 7th 11 12:15 PM
Duplicate entries wally New Users to Excel 5 October 30th 09 04:47 AM
Duplicate entries Western_man Excel Worksheet Functions 5 February 14th 09 04:14 AM
duplicate entries HR Director Excel Worksheet Functions 5 January 1st 09 06:19 AM
Duplicate Entries Phxlatinoboi® Excel Discussion (Misc queries) 2 August 24th 06 01:17 AM


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"