Results 1 to 9 of 9

Macro to Find Duplicate Values in Two Workbooks

Threaded View

  1. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to Find Duplicate Values in Two Workbooks

    Hi beewketu,

    Try this:

    Sub beewketu(): Dim r As Long, wa As Worksheet, wc As Worksheet
                    Dim TID As Object, ID As String, D As Range
                Set wa = Workbooks("Archive").Sheets("Sheet1")
                Set TID = CreateObject("Scripting.Dictionary")
                Set wc = Workbooks("Current File").Sheets("Sheet1"):
                For r = 3 To wa.Range("A" & Rows.Count).End(xlUp).Row
                ID = Trim(wa.Range("A" & r)): TID.Item(ID) = r: Next r
                For r = 3 To wc.Range("A" & Rows.Count).End(xlUp).Row
                        ID = Trim(wc.Range("A" & r))
                        If TID.Exists(ID) Then
               If D Is Nothing Then Set D = wc.Range("A" & r) Else _
                Set D = Union(D, wc.Range("A" & r))
                End If: Next r
                
                If D Is Nothing Then
                MsgBox "No dupes exist"
                Else
                D.EntireRow.Interior.ColorIndex = 6: End If
    End Sub
    Last edited by xladept; 09-10-2015 at 06:40 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to find duplicate values in different workshhet and change cell colour.
    By Gaztr1x in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2015, 04:12 PM
  2. Macro VBA to comapare two sheets to find duplicate values
    By sumera12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2014, 06:37 AM
  3. Find and identify duplicate data across multiple workbooks
    By raw_geek in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-23-2013, 02:27 PM
  4. [SOLVED] Macro to find duplicate values in a column and add the corresponding rows
    By hoss88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2013, 05:40 AM
  5. How to find duplicates from two workbooks (if duplicate add new value in the list)
    By megaexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2012, 05:18 PM
  6. Macro to find duplicate values
    By lizzieb in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-06-2010, 04:50 AM
  7. [SOLVED] 2 workbooks - how do I find duplicate entries by comparing the two
    By queen on in forum Excel General
    Replies: 2
    Last Post: 09-20-2005, 07:05 AM

Tags for this Thread

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