Actually tested, but still not as brilliant as Claus' wizardry!
Function myNames$(myRange As Range)
Dim vNames, vTmp(), s1$
s1 = myRange.Value
If vNames(1) = vNames(UBound(vNames)) _
And UBound(vNames) 1 Then
vNames = Split(s1, " "): ReDim vTmp(UBound(vNames) - 1)
vTmp(0) = vNames(0): vTmp(1) = vNames(2)
vTmp(2) = vNames(3): vTmp(3) = vNames(4)
s1 = Join(vTmp, " ")
End If
myNames = s1
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