Dear Rajan,

We can use it..

Function NTest(rng As String)
Dim ch As String
Dim i As Integer
Dim j As Integer
With Application.WorksheetFunction
rng = .Trim(.Substitute(rng, "|", ""))
For j = 1 To Len(rng)
    If VBA.Mid(rng, 1, 1) <> vbNullString Then
        ch = VBA.Mid(rng, 1, 1)
        rng = .Trim(.Substitute(rng, ch, ""))
        NTest = .Trim(NTest & ch & "|")
    Else
        Exit For
    End If
Next j
End With
NTest = Left(NTest, Len(NTest) - 1)
End Function

see the attachment.

-- 
With Regards,
Noorain Ansari
http:// 
<http://www.noorainansari.com/>noorainansari.com<http://www.noorainansari.com/>
http:// 
<http://www.excelvbaclinic.blogspot.com/>excelvbaclinic.com<http://www.excelvbaclinic.blogspot.com/><http://accesssqclinic.blogspot.in/>


On Thu, Aug 9, 2012 at 8:21 PM, Rajan_Verma <rajanverma1...@gmail.com>wrote:

> * *
>
> *Any Reply???*
>
> * *
>
> * *
>
> *Regards*
>
> *Rajan verma*
>
> *+91 7838100659 [IM-Gtalk]*
>
> * *
>
> *From:* Rajan_Verma [mailto:rajanverma1...@gmail.com]
> *Sent:* 08 August 2012 9:33
> *To:* excel-macros@googlegroups.com
> *Subject:* Excel Formula challenge ****
>
> ** **
>
> * *
>
> *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.


Attachment: Test.xlsm
Description: Binary data

Reply via email to