+ Reply to Thread
Results 1 to 10 of 10

Help Needed- Excel macro to compare two columns in two worksheets and highlight duplicates

  1. #1
    Registered User
    Join Date
    10-07-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Help Needed- Excel macro to compare two columns in two worksheets and highlight duplicates

    I am looking for macro that can compare two columns between two worksheets and highlight the duplicates. I only want Column A on sheet1 to be compared Column A on sheet2. Currently I am using the below macro but it finds duplicates in all columns. My Column B is a date stamp and alot dates are the same so it will high light muchof the column when I dont really need that.

    Please Login or Register  to view this content.

    Thanks
    Last edited by advent; 10-10-2013 at 05:18 PM.

  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,873

    Re: Excel macro to compare two columns in two worksheets and highlight the duplicates

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them this time. Please read and understand our rules for the future.)
    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
    10-07-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Help Needed- Excel macro to compare two columns in two worksheets and highlight duplic

    bump no response

  4. #4
    Registered User
    Join Date
    10-07-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Help Needed- Excel macro to compare two columns in two worksheets and highlight duplic

    bump.. anyone have any suggestions? Is there anyway to just compare column a on sheet1 with column A on sheet2?

  5. #5
    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,873

    Re: Help Needed- Excel macro to compare two columns in two worksheets and highlight duplic

    you might get a better response if you posted a copy of your spreadsheet so that it can be analyzed and proper solution provided.

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  6. #6
    Registered User
    Join Date
    10-07-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Help Needed- Excel macro to compare two columns in two worksheets and highlight duplic

    Quote Originally Posted by alansidman View Post
    you might get a better response if you posted a copy of your spreadsheet so that it can be analyzed and proper solution provided.

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Ok thanks for the advice.

    here is the workbook. test2.xls


    The macro that I am currently using works but it is also looking for duplicates and highlighting in column B and C. I just want the macro to compare and highlight column A of both sheets.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Help Needed- Excel macro to compare two columns in two worksheets and highlight duplic

    I have found two duplicates ONLY=885482865671 AND 886923286093
    Do you want to highlight the entire row, or just a single cell-column A only?

  8. #8
    Registered User
    Join Date
    10-07-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Help Needed- Excel macro to compare two columns in two worksheets and highlight duplic

    just the single cell in column a.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Help Needed- Excel macro to compare two columns in two worksheets and highlight duplic

    Try the attached.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    10-07-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Help Needed- Excel macro to compare two columns in two worksheets and highlight duplic

    That works.. Thank you so much.

+ 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] Macro to Compare Columns A & B and dispaly any duplicates in Columns C & D
    By robertguy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2013, 02:24 AM
  2. [SOLVED] Compare columns in different worksheets nad highlight differences
    By intercooler in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-13-2012, 01:05 PM
  3. Compare Two Columns Between Two Worksheets, keep duplicates, delete others, copy new
    By navyav8er in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-14-2012, 03:59 PM
  4. Replies: 5
    Last Post: 07-05-2011, 06:25 PM
  5. macro to compare columns and highlight common rows
    By jagman1990 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-22-2010, 12:27 PM

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