Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Laxman A Patil
 
Posts: n/a
Default How can delete the duplicate word from a string in cell in EXCEL

How we can delete the duplicate word from a string from a particular cell in
EXCEL
  #2   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default How can delete the duplicate word from a string in cell in EXCEL

You can use a custom formula, using the regular expression component from
vbscript (it should be installed in your computer by default)
Open the Visual Basic Editor (Alt+11), create a new module (menu Insert -
Module) and paste the following:

Function RemoveDup(str1)
Dim regEx
Set regEx = CreateObject("vbscript.regexp")
regEx.Global = False
regEx.Pattern = "\b(\w+)\b\s+\1"
regEx.IgnoreCase = True
RemoveDup = regEx.Replace(str1, "$1")
End Function

Then you can use this function in your workbook, just typing =RemoveDup(A1),
for example.
The formula will remove the first repeated word, for removing all repeated
words change the line with regEx.Global = False to regEx.Global = True.

Hope this helps,
Miguel.

"Laxman A Patil" wrote:

How we can delete the duplicate word from a string from a particular cell in
EXCEL

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract MS Excel Data embedded in MS Word qualityprocess Excel Discussion (Misc queries) 0 April 20th 06 05:52 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
How do I imbed a Word document into an Excel cell? Baxter Excel Discussion (Misc queries) 2 March 12th 05 01:55 PM
How to delete duplicate rows in Excel 2000? PAL@Emory Excel Discussion (Misc queries) 1 January 28th 05 03:08 PM
Extract hyperlink string from excel cell Ryan Sapien Links and Linking in Excel 1 January 20th 05 12:24 AM


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"