+ Reply to Thread
Results 1 to 3 of 3

Identifying duplicate entries in multiple sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    VA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Identifying duplicate entries in multiple sheets

    Hello all,

    I have a workbook I use to track items. Each sheet is a different phase of development. But this sheet is shared between multiple users and often duplicates get left around. I'm looking for a quick way to identify them and alert of their existence (it could be purposeful, so deleting wouldn't be helpful).

    There are unique identifiers in columns A and B. So Ideally, excel would check if the values in column A and B for 1 row existed together in another row for column A and B of that sheet or another worksheet. If it found them, it would display a text box indicating the sheet names on which the duplicates were located and their row numbers.

    I have some VBA experience but not with anything like this. I've searched the forum but haven't found anything to get me started. Any help would be appreciated.

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Identifying duplicate entries in multiple sheets

    Really need you to upload the file.. otherwise we are shooting in the dark
    Elegant Simplicity............. Not Always

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Identifying duplicate entries in multiple sheets

    Try this:-
    Sub MG03Apr44
    Dim Rng     As Range
    Dim Dn      As Range
    Dim Ws      As Worksheet
    Dim Twn     As String
    Dim Q
    With CreateObject("scripting.dictionary")
    .CompareMode = vbTextCompare
    For Each Ws In Worksheets
        With Ws
        Set Rng = .Range(.Range("A1"), .Range("A" & Rows.Count).End(xlUp))
    End With
    For Each Dn In Rng
        Twn = Dn & Dn.Offset(, 1)
            If Not .Exists(Twn) Then
                .Add Twn, Array(Ws.Name & Dn.Address, 1)
            Else
                Q = .Item(Twn)
                    Q(0) = Q(0) & Chr(10) & Ws.Name & Dn.Address
                    Q(1) = Q(1) + 1
                .Item(Twn) = Q
    End If
    Next
    Next Ws
    
    Dim K, t
    Dim Txt As String
     For Each K In .keys
        If .Item(K)(1) > 1 Then
           Txt = Txt & .Item(K)(0) & Chr(10) & Chr(10)
        End If
    Next K
    If Txt = "" Then
        MsgBox "No Dups found"
    Else
        MsgBox "These are the Dup Ranges :-" & Chr(10) & Txt
    End If
    End With
    End Sub
    Regards Mick

+ 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