Another way Function MYFUNC(str As String)
Dim strg With CreateObject("Scripting.Dictionary") .CompareMode = 1 If str <> "" Then For Each strg In Split(str, "|") .Item(Trim$(strg)) = Empty Next End If MYFUNC = Join(.keys, "|") End With End Function Regards, Sam Mathai Chacko On Sun, Sep 16, 2012 at 7:40 PM, dguillett1 <dguille...@gmail.com> wrote: > Put this function in a REGULAR module. Then =myfunc(a1) > > Function myfunc(xx) > Dim nodupes As New Collection > arr = Split(xx, "|") > For i = LBound(arr) To UBound(arr) > On Error Resume Next > nodupes.Add arr(i), arr(i) > On Error GoTo 0 > Next i > For i = 1 To nodupes.Count > holder = holder & nodupes(i) & "|" > Next i > myfunc = Left(holder, Len(holder) - 1) > End Function > > Don Guillett > Microsoft Excel Developer > SalesAid Software > dguille...@gmail.com > > *From:* in.vaib...@gmail.com > *Sent:* Saturday, September 15, 2012 12:19 PM > *To:* excel-macros@googlegroups.com > *Subject:* Re: $$Excel-Macros$$ Re: Excel Formula challenge > > It workz for the given case but if more txt is der den formula wil run for > milez :p > > I'm figuring formula dat wl work for all cases. > > > Rgds > ------------------------------ > *From: *"Rajan_Verma" <rajanverma1...@gmail.com> > *Sender: *excel-macros@googlegroups.com > *Date: *Sat, 15 Sep 2012 22:38:16 +0530 > *To: *<excel-macros@googlegroups.com> > *ReplyTo: *excel-macros@googlegroups.com > *Subject: *RE: $$Excel-Macros$$ Re: Excel Formula challenge > > > *Nicely done* > > ** > > ** > > *Regards* > > *Rajan verma* > > *+91 7838100659 [IM-Gtalk]* > > ** > > *From:* excel-macros@googlegroups.com [mailto: > excel-macros@googlegroups.com] *On Behalf Of *Vabz > *Sent:* 15 September 2012 10:04 > *To:* excel-macros@googlegroups.com > *Subject:* $$Excel-Macros$$ Re: Excel Formula challenge**** > > **** > > Hi**** > > **** > > PFA**** > > **** > > Cheerz..**** > > **** > > Rgds//Vabs**** > > **** > > > On Wednesday, August 8, 2012 9:33:25 PM UTC+5:30, Rajan_Verma wrote:**** > > * ***** > > *Hi group,***** > > * ***** > > *Hope you will post an excellent solution here :***** > > *Let suppose you have a string like below :***** > > *A|A|A|B|B|C|A|B|C|D***** > > *As you can see the characters are being repeat in this string ***** > > *output should be : A|B|C|D***** > > *I don’t think helper column is required **J***** > > * ***** > > *You can comment here also***** > > *http://excelpoweruser.wordpress.com/2012/08/08/excel-formula-challenge/** > *** > > * ***** > > * ***** > > *Regards***** > > *Rajan verma***** > > *+91 7838100659 [IM-Gtalk]***** > > **** > > -- > Join official facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES (1120+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > 6) Jobs posting is not allowed. > > 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To post to this group, send email to excel-macros@googlegroups.com. > To unsubscribe from this group, send email to > excel-macros+unsubscr...@googlegroups.com. > > **** > -- > Join official facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES (1120+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > 6) Jobs posting is not allowed. > > 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To post to this group, send email to excel-macros@googlegroups.com. > To unsubscribe from this group, send email to > excel-macros+unsubscr...@googlegroups.com. > > > -- > Join official facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES (1120+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > 6) Jobs posting is not allowed. > > 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To post to this group, send email to excel-macros@googlegroups.com. > To unsubscribe from this group, send email to > excel-macros+unsubscr...@googlegroups.com. > > > > -- > Join official facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES (1120+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > 6) Jobs posting is not allowed. > > 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To post to this group, send email to excel-macros@googlegroups.com. > To unsubscribe from this group, send email to > excel-macros+unsubscr...@googlegroups.com. > > > -- Sam Mathai Chacko -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com.