Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check if text box has more than one entry seperated by a comma | Excel Programming | |||
Importing Text File with Comma Seperated Data - Need Help Pls | Excel Discussion (Misc queries) | |||
Comma Seperated File | Excel Worksheet Functions | |||
How to split a value seperated by comma? | Excel Discussion (Misc queries) | |||
Importing Comma Seperated Text Please Help ? | Excel Discussion (Misc queries) |