Good morning to all you fine Excel gurus.
Here’s my problem today. I have a column of names that are separated by both a pound sign (#) and a semicolon. My task is to convert the names into initials and populate the same cell with the initials rather than the full names, as the column of names is part of a much larger dataset. I have attached a sample file. I got as far as trying this code before I decided to throw in the towel and ask the pros:
For Each RngCell In OwnRng
txt = RngCell.Value
z = Split(txt, “#”)
If UBound(z) > 0 Then
For i = 0 To UBound(z)
RngCell.Value = z(i) & “,”
Next i
End If
Next RngCell
Naturally, it doesn’t work. It doesn’t do anything about using the initials instead of the full names, and it only grabs the last name in a string. The more I thought about it the more I realized I am not sure how to proceed.
I already have a workaround, where I copy the column of names into a blank column, parse them, replace the full names with the initials, then concatenate and copy back to the original column.
But I thought there might be a more elegant programmatic solution, thus I am again seeking advice and counsel.
As always, I am grateful for any advice or thoughts…