separating a list

B

Brian

I have a column of names 1800 rows long in the format
Last, First Middle that I would like to separtate into two
columns Last and First Middle - sort of like a reverse
concatentate.

Any suggestions?

Brian
 
J

Jean-Paul Viel

Hi,



First, save your book, put your active cell in the column you want to split
and then try this code:



Sub SepName()

Dim rg As Range

Dim intR As Integer

On Error Resume Next

For Each rg In ActiveCell.CurrentRegion

rg.Offset(0, 1) = Left(rg.Text, InStr(rg.Text, ",") - 1)

rg.Offset(0, 2) = Trim(Right(rg.Text, Len(rg.Text) - InStr(rg.Text,
",")))

Next rg

End Sub
 

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