+ Reply to Thread
Results 1 to 12 of 12

Trying to remove duplicate text within a cell

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Trying to remove duplicate text within a cell

    Hey everyone,

    I have a long list of around 400 phrases, all in their individual cells. My problem is some of the terms have duplicate words in them.

    Here's an example: http://i51.tinypic.com/1ttpg5.jpg

    Is there any way to remove this duplicate text from the cell?

    Thanks,
    Russell

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Trying to remove duplicate text within a cell

    Realistically you would need to use a User Defined Function for this (VBA).

    One such example being:

    Please Login or Register  to view this content.
    The above, stored in a standard Module in a Macro Enabled file would be called from your Excel sheet like any other function, eg:

    Please Login or Register  to view this content.
    Space delimiter is assumed if not specified.

    There are plenty of alternate routes you can take for this type of thing.

  3. #3
    Registered User
    Join Date
    11-17-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Trying to remove duplicate text within a cell

    Have just installed & working well BUT only for cells that have less than 255 characters! I have cells that have many thousands in some instances. Can the code be modified?

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

    Re: Trying to remove duplicate text within a cell

    how the heck do you get many thousands in on cell! thats not what excel is intended for! and besides which with thousands there is a fair chance of just leaving gibberish!
    "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

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Trying to remove duplicate text within a cell

    Quote Originally Posted by trivia
    working well BUT only for cells that have less than 255 characters! I have cells that have many thousands in some instances. Can the code be modified?
    change

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    the former is restricted to 255 chars whereas the latter is not
    (I did not know this previously!)

    @trivia - going forward please ensure you ask your own questions in your own threads (provide links to other threads as nec.) - on this occasion given this highlights a flaw in the original I have left as is.
    Last edited by DonkeyOte; 11-18-2010 at 04:21 AM.

  6. #6
    Registered User
    Join Date
    11-17-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Trying to remove duplicate text within a cell

    Thanks! Works perfect!

  7. #7
    Registered User
    Join Date
    05-13-2013
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Trying to remove duplicate text within a cell

    I would much appreciate if this function may be converted into a SUB macro? I have the same problem, but have no idea how to do that. Thanks!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Trying to remove duplicate text within a cell

    Abramo,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  9. #9
    Registered User
    Join Date
    05-13-2013
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Trying to remove duplicate text within a cell

    Many thanks for letting me know about forum posting rules. Have now started a new thread as suggested.
    http://www.excelforum.com/excel-prog...76#post3238076

  10. #10
    Registered User
    Join Date
    05-22-2014
    Posts
    1

    Re: Trying to remove duplicate text within a cell

    Worked perfectly, thanks Donkey0te!

  11. #11
    Registered User
    Join Date
    12-12-2014
    Location
    Pakistan
    MS-Off Ver
    Excell 2010
    Posts
    2

    Re: Trying to remove duplicate text within a cell

    Could it be done using formula rather then macros?

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

    Re: Trying to remove duplicate text within a cell

    see post #8

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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