Good day,
I have a spread sheet where I've got to change the names, eg The name Paul Dechristian with this formula:
=TRIM(RIGHT(B2,LEN(B2)-FIND(" ",B2))&", "&LEFT(B2,FIND(" ",B2)-1))
would be Dechristian, Paul.
I tried using a code Donkeyote used to solved a problem on this forum:
Sub Example()
With Range(Cells(1, "B"), Cells(Rows.Count, "B").End(xlUp))
.Value = Evaluate("IF(ISTEXT(" & .Address & "),PROPER(SUBSTITUTE(" & .Address & ","" "","", "",1)),REPT(" & .Address & ",1))")
End With
End Sub
I changed it to this:
Sub Example1()
With Range(Cells(1, "B"), Cells(Rows.Count, "B").End(xlUp))
.Value = Evaluate("IF(ISTEXT(" & .Address & "),TRIM(RIGHT(" & .Address & ",LEN(" & .Address & ")-FIND("" "",& .Address)),REPT(" & .Address & ",1))")
End With
End Sub
but I get #VALUE! for all the cells.
What am I doing wrong?
Thanks,
Xrull
Bookmarks