Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default How to remove duplicate text with comma seperated

This will be a lot faster, but bear in mind it will alter the original
string:

Function ReplaceDupsInCSV(str As String) As String

Dim i As Long

For i = Len(str) - 1 To 1 Step -3
If InStr(1, str, Mid$(str, i, 2)) < i Then
Mid$(str, i, 2) = "--"
End If
Next i

ReplaceDupsInCSV = Replace(str, ",--", vbNullString)

End Function


You could make it a lot faster still if you use one of the Replace functions
he
http://www.xbeat.net/vbspeed/c_Replace.htm


RBS


"geniusideas" wrote in message
...
Hi,

In VBA how to remove duplicate text seperated by comma example :

Example : One Cells contained

Before - AE,AE,DE,BE,CE,CE,FE,GE,GE

After - AE,DE,BE,CE,FE,GE

Can some one give me the code.Thanks


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
Check if text box has more than one entry seperated by a comma Les Excel Programming 2 September 16th 08 12:22 AM
Importing Text File with Comma Seperated Data - Need Help Pls Brando Excel Discussion (Misc queries) 1 April 17th 08 04:59 AM
Comma Seperated File Ricardo0303 Excel Worksheet Functions 2 April 10th 07 04:45 PM
How to split a value seperated by comma? Ticktockman Excel Discussion (Misc queries) 2 March 23rd 06 04:20 PM
Importing Comma Seperated Text Please Help ? Byron Excel Discussion (Misc queries) 1 August 16th 05 10:36 AM


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

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

About Us

"It's about Microsoft Excel"