View Single Post
  #6   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

Hi Joan,

Am Fri, 26 May 2017 18:18:39 +0100 schrieb JoannieMaj:

WOW - that worked (the UDF) beautifully. THANK YOU.

I'm going to use it, but I've got the issue that the (#&$)(@*&# list has
names like this:

Joan Major and Jack Major
Sally Brown
Bill Smith and Susan Smith
Jean Baker and Bob Baker
Elizabeth Thompson

It is shaving off the last names of those in the cells that only have
one person in them. Still - this helps so much - THANK YOU!!!!


download the test file from here (macros are disabled in OneDrive):
https://1drv.ms/x/s!AqMiGBK2qniTgZN1558VWDDLeTHzmw


Regards
Claus B.


Suggestion:
Search your array for dupes and if found build a new value...

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

--
Garry

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