Forum Discussion

KellyHunka's avatar
KellyHunka
Copper Contributor
Oct 06, 2020

Removing commas and put first name first

Hi @, 

I have a list of names (last name, first name). I want (first name last name) Surely this can be done. Anyone?

Thanks for the look,

Kelly

1 Reply

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    KellyHunka 

     

    With your permission, if I can recommend. It can help us all if you upload an Excel file (without sensitive data), no picture. So you could get a precise solution much faster. This would also be a blessing for us, as we can understand the problem much better, a win-win situation for everyone.

    * Knowing the Excel version and operating system would also be an advantage.

     

    Not the less I would like to try to give you some information about the possible possibilities.

    One possibility could be VBA

     

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Count > 1 Or Target.Column <> 6 Then Exit Sub
        If InStr(Target, ",") > 0 Then
            Application.EnableEvents = False
            Target = Replace(Target, ",", "")
            Application.EnableEvents = True
        End If
    End Sub
    
    ' You just have to change the columns / cells according to your needs.

     

     

    A second possibility is to try a formula, here is an example (which you should also adapt):

    Here's a simple formula that will get the job done correctly: = LEFT (NN, SEARCH ("", NN) - 1) 

    where NN is the cell that stores the name.

    The -1 is there to remove the extra space or comma at the end of the string.

     

    Thank you for your understanding and patience

     

    I would be happy to know if I could help.

     

    Nikolino

    I know I don't know anything (Socrates)

     

    * Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

     

     

Resources