I have string name with salutation
DATIN SERI PADUKA JOHN DOE with actual name is JOHN DOE
and i have list excel for salutation :
DATIN SERI
DATIN SERI PADUKA
Currently using substitute function from VBA :
For index=2 to totalRow
SalutationArray = Split(ws.Range("A"&index), " ")
For N = 0 to UBound(SalutationArray)
strSalutation = SalutationArray(N)
ws.Range("B" & index) = WorksheetFunction.Substitute(strName,strSalutation,"")
Next index
The output result is
PADUKA JOHN DOE with space in front
how to achieve output result is only JOHN DOE with that list salutation
ws.Range("A"&index)on space and not vbLf (if the values are all in the same cell)