• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Assistance to find a macro to remove a symbol and then split the title, name and last name

Joe Mazzone

New Member
Good morning.
May you please assist with the following:
I have a simple sheet with Title, Name, and Last Name columns (C, D, and E). These columns are empty. In column F, there are the names of guests, but it has the full name.
In column F, some names begin with the symbol "*."

I would love this:

1. Separate the title (Mr., Mrs., or Ms..) and place it in column C of TITLE.
2. Separate the name and place in column D of NAME.
3. Separate the last name and place it in column E of LAST NAME.
The result must look like the image below:
1746599250812.png
Is it possible to be done?
I would appreciate it.
Thank you so much in advance.
 

Attachments

  • Names Order.xlsm
    18.5 KB · Views: 5
In column F, some names begin with the symbol "*."
I could find sometimes only "*" ...
Usage: Press [ Split ]-button
 

Attachments

  • Names Order.xlsb
    25.3 KB · Views: 5
Hello, a full VBA array demonstration :​
Code:
Sub Demo1()
    Dim V, R&
   With Range("C2", [F1].End(xlDown))
        V = .Value2
    For R = 1 To UBound(V)
        V(R, 4) = Split(Replace(V(R, 4), "*", ""), ",")
        V(R, 1) = V(R, 4)(2)
        V(R, 2) = V(R, 4)(1)
        V(R, 3) = V(R, 4)(0)
    Next
       .Columns("A:C") = V
   End With
End Sub
 
Another way, a row by row update rather than cell by cell (vs my first demonstration updating all at once) :​
Code:
Sub Demo2()
         Dim Rw As Range
   With Application
       .ScreenUpdating = False
    For Each Rw In Range("C2", [F1].End(xlDown)(1, 0)).Rows
             Rw = .Index(Split(Replace(Rw.Range("D1"), "*", ""), ","), 1, [{3,2,1}])
    Next
       .ScreenUpdating = True
   End With
End Sub
 
Back
Top