+ Reply to Thread
Results 1 to 6 of 6

Compare two Ranges

  1. #1
    Registered User
    Join Date
    12-14-2010
    Location
    Texas,United Stated
    MS-Off Ver
    Excel 2007
    Posts
    63

    Compare two Ranges

    Hi All,
    See attached. I need a macro that will compare the "New Range" with the "Original Range". If there is a value in the new range that is not in the original range, I would like a msg box to appear and say "Invaild ID Number" and then highlight either the cell or the text in Red.

    Thanks In Advance
    Attached Files Attached Files
    Last edited by jbmerrel; 04-06-2012 at 03:00 PM.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Compare two Ranges

    Why not use a formula. Insert this in C3 =IF(ISBLANK(B2),"",IF(ISERROR(VLOOKUP(B2,A:A,1,0)),"X","")) and highlight Column C > Conditional Formatting, New Rule, enter =$C1="X", and select your custom format

  3. #3
    Registered User
    Join Date
    12-14-2010
    Location
    Texas,United Stated
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Compare two Ranges

    I wish I could but it must be a macro in this case. I have other things in columns C-AE. I need the macro to just check the one column and compare it to the original range.

    Thank you for your response

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Compare two Ranges

    Insert this to your worksheet module

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-14-2010
    Location
    Texas,United Stated
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Compare two Ranges

    Thank you!!!!!!

  6. #6
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Compare two Ranges

    No message box, and no VBA. Conditional formatting can still highlight in red.

    Pauley
    Attached Files Attached Files

+ 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