+ Reply to Thread
Results 1 to 3 of 3

Macro that highlights cells in one column that do not exist in another similar column

  1. #1
    Registered User
    Join Date
    02-22-2017
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    11

    Red face Macro that highlights cells in one column that do not exist in another similar column

    I have a file with 2 columns that are around 7000 cells long and contain mostly the same information. I want to make the cells on one column that do not exist on the other column yellow. Also, these sheets are on separate sheets so I think I have to use a sheet variable(?).

    The one I want to have cells that turn yellow is column F on sheet 4 and the one I want to compare it with is sheet 3 row E. I made and uploaded a test file with with the exact sheets/row. So with this file I need a macro that will turn the cells that aren't on the column on the third sheet E but are on the fourth sheet F turn yellow.

    I would greatly appreciate any type of help. Thank you.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Macro that highlights cells in one column that do not exist in another similar column

    Hi,
    Try this code:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Macro that highlights cells in one column that do not exist in another similar column

    You don't actually need a macro for this - Conditional Formatting can be used to highlight cells whose value does not appear in another list using a formula -

    =COUNTIF(Sheet3!$E$1:$E$10, F1) = 0

    Add that to the Conditional Formatting rules for cell F1 on sheet4, set the formatting/background as you want and then Copy/PasteSpecial/Formats over the range you need.

    Accepting I do not know exactly how your worksheet is processed this may not be suitable for you but inbuilt Excel functions are much faster than any VBA code...

+ 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] Conditional formula IF column X is greater than Zero than column P highlights cell
    By rz6657 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-24-2016, 11:00 AM
  2. Replies: 0
    Last Post: 03-31-2015, 01:23 PM
  3. [SOLVED] Find if duplicate values exist in a column, concatenate cells and then de
    By filky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2014, 10:14 PM
  4. [SOLVED] Search Value of column E if exist return value of column B put result in column P
    By hassan khansa in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-23-2013, 11:39 AM
  5. [SOLVED] Macro to remove entire row if null value exist in column C
    By sarat47.dash in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-18-2013, 01:55 PM
  6. [SOLVED] Macro that searches a column for all the blank cells then highlights the row entire row.
    By TheOllie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2012, 09:41 AM
  7. Change font to red if 2 or more identical cells exist in a column
    By jonrayworth in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2007, 05:27 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