+ Reply to Thread
Results 1 to 8 of 8

Remove duplicate text in cell

  1. #1
    Registered User
    Join Date
    11-10-2009
    Location
    Kansas City Missouri USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Remove duplicate text in cell

    i have a cell in excell that has a string of txt, more like a paragraph. and i want to serch through the string of txt in the cell to make sure there are no duplicates. How would i go about doing this? Sample cell A2, has the the txt "see the dog run. See the dog run. See the dog run." and i want to erase all but the first instance. How would i do that?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: duplice txt in a cell

    Trying to do that is going to open up a maintenance nightmare. There's thousands of variables, right?

    Better would be to fix the process that ended up putting duplicated values into that cell. How did they get there? Can that process be tweaked to eliminate duplicates as they occur?

    Can you provide more info regarding where the dupes come from and how they get there? Can you post up a usable sample worksheet?

    Click GO ADVANCED and use the paperclip icon to post up your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-10-2009
    Location
    Kansas City Missouri USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: duplice txt in a cell

    I've fixed the issue with what caused the duplicates but now i just need to scrub the data to remove the excess txt.

  4. #4
    Registered User
    Join Date
    11-10-2009
    Location
    Kansas City Missouri USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Remove duplicate text in cell

    Here is workbook with just the colum with the txt.
    Attached Files Attached Files

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Remove duplicate text in cell

    what defines excess text?
    all i can see is loads of cells with catalogue descriptions what do you expect the result to be?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Remove duplicate text in cell

    No way, man. Every cell completely different. Even if you tried to construct a loop to find duplicate strings and match them, the macro would really be in trouble trying to know the string "contemporary design" is not the entire string to remove duplicates of...or "contemporary design" might be used differently in different sentences and would get deleted anyway.

    If you've fished the duplication error at the source...have the source re-issue this data now, for you.

  7. #7
    Registered User
    Join Date
    11-10-2009
    Location
    Kansas City Missouri USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Remove duplicate text in cell

    If you read through the descriptions it repeats the txt If you search for "The "Piermont" bedroom" you will see what i mean it's a fairly short desription that repeats liek 5 times. I have figured out that when it repeats it takes the first couple of words and it always where there is a "." followed by a lower case word, but then the rest of it repeats.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Remove duplicate text in cell

    This gets rid of duplicate sentences, which solves some portion of the problem. Run macro jboomer. Results appear on Sheet2.
    Attached Files Attached Files
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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