+ Reply to Thread
Results 1 to 2 of 2

Code to compare if values in two cells are the same, if yes highlight both cells green

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    Krakow, Poland
    MS-Off Ver
    Excel 2003
    Posts
    6

    Exclamation Code to compare if values in two cells are the same, if yes highlight both cells green

    Hi, I don't know VBA, but I urgently need to have simply macro which works like:

    1. Check does values in cells eg. A2 and B3 are the same.
    2. If A2=B3, then set green background in both cells.
    3. If A2 has different value than B3, then set red background of both cells.

    Could anybody please write steps above in efficient VBA code for Excel? Many thanks!

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Code to compare if values in two cells are the same, if yes highlight both cells green

    Maybe try this:

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

+ 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. [SOLVED] compare cells and highlight same
    By shart2k12 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-05-2013, 01:34 PM
  2. [SOLVED] compare values in two cells, highlight when there is no match.
    By frhling in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-03-2013, 09:29 AM
  3. 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
  4. Compare Columns and Highlight Cells
    By Daker3 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-13-2012, 11:22 PM
  5. compare two Ranges in Excel and highlight the cells that are different
    By zhshqzyc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2011, 10:47 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