str="i am busy at work in my company"
str=Replace(str," ","")
For i=1 To Len(str)-1
If Len(str)=0 Then
Exit for
End If
k=Mid(str,1,1)
If InStr(Right(str,Len(str)-1),k)>0 Then
str2=str2&k
str=Replace(str,k,"")
Else
str=Replace(str,k,"")
End If
Next
MsgBox str2
str=Replace(str," ","")
For i=1 To Len(str)-1
If Len(str)=0 Then
Exit for
End If
k=Mid(str,1,1)
If InStr(Right(str,Len(str)-1),k)>0 Then
str2=str2&k
str=Replace(str,k,"")
Else
str=Replace(str,k,"")
End If
Next
MsgBox str2