View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Removing Duplicate Names in Single Cell

Didn't think the rest was necessary but...

Function myNames$(myRange As Range)
Dim vNames, vTmp()
vNames = Split(myRange, " ")

If vNames(1) = vNames(UBound(vNames)) Then
Redim vTmp(Ubound(vNames) - 1)
vTmp(0) = vNames(0): vTmp(1) = vNames(2)
vTmp(2) = vNames(3): vTmp(4) = vNames(5)
End If
myNames = Join(vTmp, " ")
End Function

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion