+ Reply to Thread
Results 1 to 10 of 10

Find duplicates with a string of text

  1. #1
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Find duplicates with a string of text

    Hi all,

    I have a table, and in columns H:M each cell is filled with numerous postcodes separated by a comma (i.e. DY8 3NQ, DY8 3NQ, DY8 4TN, DY5 XYZ).

    Is there a way to highlight where duplicate values appear within the string of text in a cell, across all columns?

    Many thanks,

    Chris

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Find duplicates with a string of text

    Found a code that deletes duplicates if any use to you
    Please Login or Register  to view this content.
    https://stackoverflow.com/questions/...cells-in-excel

  3. #3
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Find duplicates with a string of text

    Hi Nige,

    Thanks for the response. I am looking to keep the duplicates, so I am looking for something to highlight them when they appear in a string within a cell - as this is for a comparison when looking at when particular postcodes appear within the table.

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

    Re: Find duplicates with a string of text

    See if this is how you wanted.
    If not, need to see your workbook with before/after...
    Please Login or Register  to view this content.
    Edit: Code has been replaced for multiple dup/tripl etc.
    Last edited by jindon; 10-16-2019 at 08:28 AM.

  5. #5
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Find duplicates with a string of text

    Hi Jindon,

    Thanks for your code, much appreciated. I have tested it and it does not do what I am looking for.
    Last edited by chrisellis250; 10-16-2019 at 08:53 AM.

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

    Re: Find duplicates with a string of text

    You said
    each cell is filled with numerous postcodes separated by a comma (i.e. DY8 3NQ, DY8 3NQ, DY8 4TN, DY5 XYZ).
    So, my code will hi-lite the duplicate post code within a cell.
    Obviously not such...

  7. #7
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Find duplicates with a string of text

    Sorry Jindon, my description is misleading, I apologise for this.

    I am looking for duplicates across the whole worksheet, as opposed to within one cell.

    So for example if H19 has DY8 3NQ, DY8 3NG, DY8 3NF and J22 has DY8 3NQ in it then it would highlight DY8 3NQ - similar to how your code does, but not in one single cell.

    There should not be any duplicates within one single cell, but there should be multiple duplicates in the whole table itself.

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

    Re: Find duplicates with a string of text

    Dups in whole range?
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Find duplicates with a string of text

    Almost (again my description has been poor) so looking at H:M but only colouring duplicates on each row.

    So if H60 has DY8 3NQ, DY8 3NQ, DY8 4TF and J60 has DY8 3NQ then DY8 3NQ is coloured.

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

    Re: Find duplicates with a string of text

    Duplicate by row,
    Please Login or Register  to view this content.

+ 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. Replies: 5
    Last Post: 07-10-2017, 10:36 AM
  2. Replies: 4
    Last Post: 03-30-2015, 03:20 PM
  3. [SOLVED] Concatinate string of text and remove duplicates
    By msmayhugh in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-20-2015, 06:38 PM
  4. Replies: 2
    Last Post: 03-18-2015, 07:30 PM
  5. Replies: 5
    Last Post: 02-11-2015, 10:41 PM
  6. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  7. removing duplicates in a string of text
    By zapszipszops in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2008, 09:54 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