2016-01-29 130 views

回答

2

對於公式中使用:

=MID(A1,FIND(" ",A1)+1,999) & ", " & LEFT(A1,FIND(" ",A1)-1) 

enter image description here

我們下一個問題:如果有什麼不只是第一個和最後一個名字嗎?

使用此:

=MID(A1,FIND("}}}",SUBSTITUTE(A1," ","}}}",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,999) & ", " & LEFT(A1,FIND("}}}",SUBSTITUTE(A1," ","}}}",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))-1) 

它將承擔最後一個字是姓。要轉換和運行這個小宏

![enter image description here

2

只選擇細胞:

Sub NameFixer() 
    For Each r In Selection 
     ary = Split(r.Value, " ") 
     r.Value = ary(1) & ", " & ary(0) 
    Next r 
End Sub 
1

交替式的解決方案:

=LEFT(TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99))&", "&A1,LEN(A1)+1)