Consulting

Results 1 to 7 of 7

Thread: Solved: Auto find duplicate entries

  1. #1
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location

    Solved: Auto find duplicate entries

    Ok vbax superhero's,
    I think this one should be fairly easy, but I am not sure where to start. I am looking to implement a macro the will catch duplicate employee id's or ssn #'s. I create logins for users, and do not want to make duplicate IDs for the same user, and to have it catch this right away would be awsome. Can anyone attach a small working file with an example to get me started? Thanks.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Have a look at the following.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location
    thanks for the response.

    I typed in 100048034 over 5 times, and it never caught the duplicate(s), but when I type what is already previously there, it says "ID used", so it does and doesnt work?

    I will try the code you have there and mess with it a bit.

    Is it possible, to have a macro run a whole column and check for duplicates ? I could put in a button, and after adding new users, I could just run the code, and have it search for the dups?

  4. #4
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location
    Sorry, my fault. I trimed the column, and it picked up the number. Cool. So, can we make it compare a whole column?

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    If you want to check a column for duplicates, you can't do much better than this tool.
    http://members.iinet.net.au/~brettdj/
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    My code will not find existing duplicates as the add-in will, but it will prevent new duplicates being created. It really depends upon your sheet layout to determine the best method of data entry/checking. If you can post a sanitized sample, maybe we can advise further.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location
    Quote Originally Posted by mdmackillop
    If you want to check a column for duplicates, you can't do much better than this tool.
    http://members.iinet.net.au/~brettdj/
    Perfect. Solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •