+ Reply to Thread
Results 1 to 5 of 5

HELP! Compare cells of a column to same column in different workbook and highlight diffs

  1. #1
    Registered User
    Join Date
    06-25-2013
    Location
    VA
    MS-Off Ver
    Excel 2007
    Posts
    3

    HELP! Compare cells of a column to same column in different workbook and highlight diffs

    Hi,

    I am essentially a complete novice at VBA. I have used it in the past but usually only by recording a macro to do what I want, looking at the macro code and attempting to make it automated.

    I am working with 2 workbooks of production order data. What I have is a file from last week and a 2nd file from this week. Completed orders will drop out of the 2nd file and I'm not concerned with those. New orders will show up in the 2nd file but there is nothing that identifies them as new orders. What I would like to do is compare each order from the 2nd file to the orders in the 1st file and change the font color of (or highlight) the entire row in the 2nd file if the order is NOT in the 1st file. These would be the new orders I want to view. I have been trying to use the .Find command but am not having any luck. Here is some sample data and the code I am tyring to create. Each order number is unique so there will not be duplicates.

    Any help is greatly appreciated.

    Thanks,

    Bradley

    P.S. - Row 1 is blank, Row 2 contains headers and Row 3 begins data
    P.P.S. - I am unable to upload a file with the data and macro code, sorry.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by bradleyherron; 02-04-2014 at 09:09 AM. Reason: correct title to be more accurate

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: HELP! Compare cells of a column to same column in different workbook and highlight dif

    A simple vlookup will tell you if the data in the first file is in the second file

    Data Range
    A
    B
    C
    D
    E
    F
    G
    3
    Order_Number
    Due_Date
    P/N
    In Second W/B
    Order_Number
    Due_Date
    P/N
    4
    500907482
    4/18/2012
    ITM003690488
    No
    50175100
    10/23/2014
    SAP000000000540183
    5
    500907483
    4/18/2012
    ITM003690488
    No
    50175101
    11/10/2014
    SAP000000000540184
    6
    50194300
    11/10/2014
    SAP000000000539503
    Yes
    50284344
    10/28/2014
    SAP000000001222638
    7
    500903885
    4/30/2012
    ITM003694834
    No
    50194300
    11/10/2014
    SAP000000000539503
    8
    50284344
    10/28/2014
    SAP000000001222638
    Yes
    50211316
    11/10/2014
    SAP000000000539479
    9
    50284345
    10/28/2014
    SAP000000001222639
    Yes
    50284345
    10/28/2014
    SAP000000001222639

    In cell d4 type: =IF(ISERROR(VLOOKUP(A4,$E$4:$E$9,1,0)),"No","Yes") and copy down.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-25-2013
    Location
    VA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: HELP! Compare cells of a column to same column in different workbook and highlight dif

    That's pretty much what I'm doing now. I was looking for something more elegant and automated. Thanks.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: HELP! Compare cells of a column to same column in different workbook and highlight dif

    This can be automated with VBA, but what do you consider elegant? Suggest you tell us how you would like the results displayed.

  5. #5
    Registered User
    Join Date
    06-25-2013
    Location
    VA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: HELP! Compare cells of a column to same column in different workbook and highlight dif

    Quote Originally Posted by alansidman View Post
    This can be automated with VBA, but what do you consider elegant? Suggest you tell us how you would like the results displayed.
    Elegant - button on Quick Access Toolbar (completed), auto-open of history file (completed), auto-save of all files (completed). I don't consider automating the copy/paste of a formula down a column to be elegant code. I consider it to be brute force and use that method because I don't have the programming knowledge to do things any other way. I indicated how I would like the results displayed in the initial post:

    Quote Originally Posted by bradleyherron View Post
    change the font color of (or highlight) the entire row
    I don't know how to step through the spreadsheet to interogate the "Yes"/"No" column to highlight the rows. I would think this same "step-through" process, or one very similar, could be used to make the comparison between files instead of using vlookup but I don't know enough about VBA [yet ] to know for sure.

    I appreciate any help and direction I can get.

+ 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 cells in a worksheet and highlight if different?
    By loulouk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-17-2012, 01:44 PM
  2. Replies: 5
    Last Post: 09-24-2012, 05:14 PM
  3. [SOLVED] compare and highlight, same row, same column, but two different worksheets
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-31-2012, 10:57 AM
  4. Compare 2 column and highlight
    By tanshida1201 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2011, 11:15 AM
  5. compare two column & highlight
    By johncena in forum Excel General
    Replies: 5
    Last Post: 04-21-2010, 05:48 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