want to extract the name and remove duplicate

rehanemis

Registered User.
Local time
Tomorrow, 03:22
Joined
Apr 7, 2014
Messages
195
Hi Professionals.

All other work has been achieved and now I would like to separate the name from like.


Original Link: suhasini-pashikanti/15/214/622[/url]
Updated Link:suhasini-pashikanti-62221415[/url]

So how do i take the Name before the Slash or dash. I have tried to got position of slash and dash, slash works fine but there are two dashes 1. between first and last name and second is after the complete name. so how can I got position of 2nd dash.

Any Suggestion?

Waiting of your answers.
 
Last edited:
Code:
Sub testsplit()

    Dim updatedlink As String
    updatedlink = "suhasini-pashikanti-62221415"
    Debug.Print "FirstName " & Split(updatedlink, "-")(0) & vbCrLf _
              & "LastName  " & Split(updatedlink, "-")(1)
End Sub

Result:

FirstName suhasini
LastName pashikanti
 
I=instring(word,"-")
SFirst = left(word,i-1)
Word=mid(word,I+1)
I=instring(word,"-")
If I>0 then
I=instring(word,"/")
SLast= left(word,I-1)
Else
Slast=left(word,I-1)
End if
 
Thanks for your suggestion but actually I am looking for not to separate the first name and last name but only want the text as :

Before
suhasini-pashikanti/15/214/622
suhasini-pashikanti-62221415

After processing
suhasini-pashikanti
suhasini-pashikanti
 

Users who are viewing this thread

Back
Top Bottom