Sub split_em_up()
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
SpacePlace = Application.WorksheetFunction.Search(" ", Cells(i, 1))
FirstName = Left(Cells(i, 1), SpacePlace)
LastName = Right(Cells(i, 1), SpacePlace)
Cells(i, 1) = FirstName
Cells(i, 2) = LastName
Next i
End Sub
Excel Workbook | ||||
---|---|---|---|---|
A | B | |||
1 | Name | |||
2 | big dan | |||
3 | hiker 95 | |||
4 | ||||
Sheet1 |
Excel Workbook | ||||
---|---|---|---|---|
A | B | |||
1 | Name | |||
2 | big | dan | ||
3 | hiker | 95 | ||
4 | ||||
Sheet1 |
Option Explicit
Sub SplitName()
' hiker95, 04/11/2011
' http://www.mrexcel.com/forum/showthread.php?t=542776
Dim c As Range, SP
For Each c In Range("A2", Range("A" & Rows.Count).End(xlUp))
SP = Split(c, " ")
c = SP(0)
c.Offset(, 1) = SP(1)
Next c
End Sub
If the first names are always one word names...I have a spreadsheet. Column A has the first name then last name, with just a space in the middle. I want to make these into 2 columns. How?
Thanks!
If the first names are always one word names...
Select the cells in question
Goto Data>Text to Columns
Delimited
Next
Select: Space
Finish