Organizing a Name in a cell

Joined
May 7, 2010
Messages
2
Reaction score
0
So the problem I have is I have an Excel Spreadsheet that has 1000 names that I'm trying to merge into word to print labels. Now I can do the merging but I need to format the indivual cells from this:

Smith, Dan
Johnson, Bob
Parker, Sara
Tucker, Lance

To this:
Dan Smith
Bob Johnson
Sara Parker
Lance Tucker

I need to remove switch the name from Last, First to First Last and then delete the comma. Any ideas? I've tried to setup a macro but I failed miserably.
 
Joined
May 7, 2010
Messages
4
Reaction score
0
use macro

Sub Macro1()
Dim str() As String, celEach As Range

For Each celEach In Selection
If InStr(1, celEach.Text, ",", vbTextCompare) >= 1 Then
str() = Split(celEach.Text, ",", , vbTextCompare)
celEach.Value = str(1) & " " & str(0)
End If
Next
End Sub

select the range you want to change, then run this macro.
 
Last edited:
Joined
May 7, 2010
Messages
2
Reaction score
0
Mobell, thanks for your help that works perfect. I've been racking my brain over this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top