+ Reply to Thread
Results 1 to 4 of 4

macro to compare and clear cells in two columns

  1. #1
    Registered User
    Join Date
    04-22-2011
    Location
    nj
    MS-Off Ver
    Excel 2010
    Posts
    24

    macro to compare and clear cells in two columns

    I have names in ranges A5:A104 and in Z6:Z105. The amount of names can be from 1 - 100 but won't go outside this range. I need a macro that will clear contents (not delete) of any cells in range A with names that are not found in range Z (clear unique names in range A). After this is done I want to clear any names in range Z that are found in range A (leaving only unique names in range Z). Thanks!


    example:

    range A --- range Z

    bob ---- bob
    tim ---- nate
    josh --- bill
    kevin -- josh


    result:
    range A ---- range Z

    bob ----- (clear)
    (clear) -- nate
    josh ----- bill
    (clear)-- (clear)
    Last edited by ncarrocino; 03-15-2016 at 05:30 PM.

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: macro to compare and clear cells in two columns

    Give this one a try:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-22-2011
    Location
    nj
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: macro to compare and clear cells in two columns

    Works perfect thanks for your help! sorry took me a little bit to reply i was away on vacation in chicago (where i see you are)!

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: macro to compare and clear cells in two columns

    I certainly can't fault you for visiting our city, I hope you enjoyed your trip!

+ 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. Macro to compare 2 cells in different columns
    By dobracik in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-19-2015, 09:14 AM
  2. Macro to Copy from 2 Columns, Paste Value in the next 2 Columns, Then clear 1st Columns
    By MHALTTUNEN in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2014, 03:34 PM
  3. [SOLVED] [Macro] Compare two columns, if cells differents, copy and delete cell
    By Skuz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-17-2013, 06:08 PM
  4. clear selection in cells across multiple columns
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2013, 12:15 PM
  5. Macro compare cells and paste to columns
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-18-2013, 05:02 PM
  6. [SOLVED] VBA Code - Compare Adjacent Cells In two columns and clear contents when a match is found
    By Langer101 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-03-2013, 06:22 AM
  7. Macro to compare cells in different columns
    By katmison in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2009, 08:31 PM

Tags for this Thread

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