+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting to find duplicate values and format cells meeting the criteria

  1. #1
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Conditional formatting to find duplicate values and format cells meeting the criteria

    Hi,

    I need a macro that allows me to compare columns A and D (sample workbook attached) and find any values appearing in both columns (duplicate values). For each case meeting the criteria, I need the corresponding cell in column A (only on A), to be formatted as strikethrough. Since I'll be using this macro in sheets (and actually workbooks) named differently than the attached sample book, I need the code to be "generic" so it can be run on any worksheet.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting to find duplicate values and format cells meeting the criteria

    Personally I think a macro is overcomplicating it.

    Add a dynamic range name called 'decimals' and define it thus:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Now add a conditional format to A2 and set the strike through
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and apply it to the column A range.

    Personally I'd be inclined to use a helper column E and filter for the value 1 since this makes it easier to spot duplicates.

    See attached
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Conditional formatting to find duplicate values and format cells meeting the criteria

    Hi Richard,

    I took me some time to understand your answer, and still don't think I got it right ... In any case, I appreciate it. Something I didn't mention is that both columns (including the Decimals one) will change in length on a weekly basis, so the range needs to be dynamic to take that into consideration.

    I'm gonna give this more thought and see if I can make your suggestion work.

    Thanks!

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Conditional formatting to find duplicate values and format cells meeting the criteria

    One way via vba.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Conditional formatting to find duplicate values and format cells meeting the criteria

    Hi Jindon,

    The code works as intended. Thank you so much!

    I do now have an additional question, something I hadn't thought about. The referred column "DECIMALS" used in my sample sheet, is in fact a weekly changing list that I keep in a workbook on my desktop. I've been copying and pasting it for every sheet I work with in order to find the duplicate values. How can I make that comparison without having to copying/pasting it manually every time? I just learned Excel can "see" and even copy data from another book, even if it's not currently opened. The workbook path is "C:\Users\axtryo\Desktop\Labels\DECIMALS.xlsx" and the book itself has only one sheet (named "List"), where I store the list in column A. No more sheets, no other columns have data.

    I hope you can help me with this!

    Thanks!

  6. #6
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Conditional formatting to find duplicate values and format cells meeting the criteria

    Jindon,

    I forgot to mention the list in the "DECIMALS" workbook, is plain text. There's no formulas, tables or any kind of extra data. Also, is it possible to find the duplicate values w/o even copying and pasting that list onto the active workbook where the rest of info is? If not, copying and pasting it is totally fine.

    Thanks!
    Last edited by axtryo; 01-11-2017 at 01:17 AM.

+ 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. Conditional Formatting for Duplicate Values based on 3rd row Criteria
    By madnhain in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-15-2014, 03:23 PM
  2. Conditional Formatting based upon meeting 2 criteria
    By kimi4989 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2014, 09:22 AM
  3. [SOLVED] Conditional Formatting Meeting Two Criteria
    By Bob Lankin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-07-2013, 10:47 PM
  4. Replies: 1
    Last Post: 09-18-2013, 02:54 AM
  5. [SOLVED] Conditional format for duplicate values based on criteria in a different cell
    By excelheaven in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2012, 11:34 AM
  6. [SOLVED] Counting the number of cells meeting conditional formating criteria
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  7. Counting the number of cells meeting conditional formating criteria
    By Jeff in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-08-2005, 09:05 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