+ Reply to Thread
Results 1 to 11 of 11

Anyway to check for duplicate entries?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-05-2008
    Location
    Ontario, Canada
    MS-Off Ver
    2010 Pro Plus
    Posts
    78

    Anyway to check for duplicate entries?

    I'm wondering if its possible to check for duplicate entries in a workbook, across multiple sheets.

    What I have is a list that keeps track of product in stock for clients. Every so often it happens that an entry is duplicated because the client has more than one product.

    I would like to have it setup so that if a clients name is duplicated, it could merge the data into the existing row, or at least warn me of a duplicate entry.


    Can it be done?
    Last edited by VBA Noob; 03-19-2009 at 05:34 PM.

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Anyway to check for duplicate entries?

    You could simply use FIND prior to making an entry.
    Not all forums are the same - seek and you shall find

  3. #3
    Registered User
    Join Date
    03-05-2008
    Location
    Ontario, Canada
    MS-Off Ver
    2010 Pro Plus
    Posts
    78

    Re: Anyway to check for duplicate entries?

    that might be a soloution if i didnt have to make 75+ entries at a time, and they need to be put in wasting as little time as possible....

  4. #4
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Anyway to check for duplicate entries?

    How do you make your entries? can you supply a sample workbook?

  5. #5
    Registered User
    Join Date
    03-05-2008
    Location
    Ontario, Canada
    MS-Off Ver
    2010 Pro Plus
    Posts
    78

    Re: Anyway to check for duplicate entries?

    Basically items come in with a clients name on it. I look at the name on the item, and add it to the sheet. Rinse Repeat

    The workbook contains multiple sheets, each sheet is for a letter of the alphabet, A - XYZ

    The sheets only track HOW MANY items each client has, not WHAT it is.

    I can provide a sample, just not right at the moment.

    Basically its just like this

    Sheet "A"
    Location | Last Name | First Name| Items| Picked Up
    a2(Bin #)| Apple     | Sharon    |   2  | [Blank]
        A3   | Anderson  | Bill      |[Blank]|  1
    the "picked Up" column shows if the client has picked up items, and how many have they picked up, compared to how many they have here.

    They may have come in previously and picked stuff up, but now they have more stuff, so its easier to just update there existing entry instead of adding a duplicate.
    Last edited by DarkSoul; 03-13-2009 at 10:49 AM.

  6. #6
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Anyway to check for duplicate entries?

    The reason i asked how you enter them is so that i could give you a quick fix to alert you as to there being a duplicate so if you simply enter in to a cell is it in a master sheet or in the individual sheets?

    I assume all you need first off is to identify that there is a duplicate and where it is?

  7. #7
    Registered User
    Join Date
    03-05-2008
    Location
    Ontario, Canada
    MS-Off Ver
    2010 Pro Plus
    Posts
    78

    Re: Anyway to check for duplicate entries?

    Basically yes, but maybe simpler, All i need to know, is if there is a duplicate when i enter the name.

    if i type in "Jones | Bill" (2 columns for first nd last) something says "Bill Jones already exists"

    It won't so much save time, but it will help reduce erronous/duplicate entries.

  8. #8
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Anyway to check for duplicate entries?

    Well for now, drop this into the worksheet code module for each sheet (right click the worksheet tab, view code) and it will alert you as to a duplicate of the first word that you type, it will find the duplicate as long as it's above where you have typed - it had to be like that as you haven't given me any informationas to where you enter the info, when you can supply a sample workbook i will work on a better solution!

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim FndDup As String
    FndDup = Cells.Find(What:=Target.Value, After:=Me.Range("A1"), LookIn:=xlFormulas, LookAt:= _
            xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
            , SearchFormat:=False).Address
            If Range(FndDup) <> vbNullString Then
            MsgBox Target.Value & " duplicate found at " & FndDup & ", taking you to the duplicate"
            Me.Range(FndDup).Select
            End If
    End Sub

  9. #9
    Registered User
    Join Date
    03-05-2008
    Location
    Ontario, Canada
    MS-Off Ver
    2010 Pro Plus
    Posts
    78

    Re: Anyway to check for duplicate entries?

    Here, I can give you the book, there is no personal information in it.

    One other question though, if I may, when I try to print this it keeps wanting to print extra pages, for instance, sheet A is 20 pages long, yet only contains a few lines of entries right now.

    If i set a print area, then I will need to keep resetting it as the list grows larger.

    I would like to print only as many pages per sheet as nessecary.

    That aside, here is the actual workbook.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-05-2008
    Location
    Ontario, Canada
    MS-Off Ver
    2010 Pro Plus
    Posts
    78

    Re: Anyway to check for duplicate entries?

    Still looking for a solution here

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Anyway to check for duplicate entries?

    Hello DarkSoul,

    You haven't explained what to do with the duplicates. If you have an order in bin "A" and a duplicate order in bin "M", what do you want to do next? Move these to seaprate sheet, combine them in bin "A" and delete bin "M", or vice versa?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1