+ Reply to Thread
Results 1 to 5 of 5

Compare Columns In Different Workbooks and Highlight Differences

Hybrid View

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

    Re: Compare Columns In Different Workbooks and Highlight Differences

    I named your books as shown in the red code:

    Sub Sunirone(): Dim wb1 As Workbook, wb2 As Workbook, r As Long, K As String
    Set wb1 = Workbooks("Sunirone1.xlsx"): Set wb2 = Workbooks("Sunirone2.xlsx")
    With CreateObject("Scripting.Dictionary")
    r = 4: Do Until wb2.Sheets("Sheet1").Range("C" & r) = ""
    K = Trim(wb2.Sheets("Sheet1").Range("C" & r)): .Item(K) = r
    r = r + 1: Loop
    r = 4: Do Until wb1.Sheets("Sheet1").Range("B" & r) = ""
    K = Trim(wb1.Sheets("Sheet1").Range("B" & r))
                If .Exists(K) Then
    wb1.Sheets("Sheet1").Range("C" & r) = "OK"
    Else
    wb1.Sheets("Sheet1").Range("C" & r) = "Not Found"
                End If
    r = r + 1: Loop
    End With
    End Sub
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  2. #2
    Registered User
    Join Date
    03-16-2013
    Location
    USA
    MS-Off Ver
    Excel 2013 2016
    Posts
    14

    Re: Compare Columns In Different Workbooks and Highlight Differences

    That helps, Thanks. It looks for each value listed in Book 1 and returns OK or NOT FOUND. It does not however look for values in Book 2 and compare it against the list in Book 1. But this is a great start. I'll try and build on this. Thx again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Compare 2 columns and highlight differences
    By zookeepertx in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2014, 01:41 PM
  2. Replies: 0
    Last Post: 07-17-2014, 10:06 AM
  3. [SOLVED] VBA to compare and highlight differences
    By REFisher14 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-19-2014, 03:18 PM
  4. [SOLVED] Compare Two Workbooks and Highlight Differences
    By mab1284 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2014, 07:35 PM
  5. Replies: 9
    Last Post: 04-18-2013, 03:54 PM
  6. [SOLVED] Compare columns in different worksheets nad highlight differences
    By intercooler in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-13-2012, 01:05 PM
  7. Compare 2 Workbooks and Highlight Differences
    By LabanM in forum Excel General
    Replies: 3
    Last Post: 10-19-2010, 11:34 AM

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