Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Make a column two columns
The easiest way is to use Text to Columns. Highlight the
names. Choose Data from the menu bar, then Text to Columns. Choose the Delimited radio button and then Next. If the name is "Last, First", check the Comma box. If it is "First Last", choose the Space box. Then Next and Finish. VBA-wise, you could use code like this: If the format is "Last, First" Sub Sample() For Each Cell in ActiveSheet.Range("A2:A" & ActiveSheet.Range("A65536").End(xlup).Row) Cell.Offset(0,1).Value = Left(Cell,Application.Find (",", Cell)-1) Cell.Offset(0,2).Value = Mid(Cell,Application.Find (", ", Cell)+2) Next Cell End Sub If the format is "First Last" Sub Sample() For Each Cell in ActiveSheet.Range("A2:A" & ActiveSheet.Range("A65536").End(xlup).Row) Cell.Offset(0,1).Value = Left(Cell,Application.Find (" ", Cell)-1) Cell.Offset(0,2).Value = Mid(Cell,Application.Find (" ", Cell)+1) Next Cell End Sub tod -----Original Message----- You can merge first name and last name to make a full name column, but is there a way to take a full name column and make it two separate columns, first and last? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i add 2 columns to make the answer apper on the 3rd column | Excel Worksheet Functions | |||
Macro to Combine 2 columns to make one column without merging | Excel Discussion (Misc queries) | |||
How can I make columns within one column? | New Users to Excel | |||
How do I make a column in Excel into two columns for only A3-A8 | Excel Discussion (Misc queries) | |||
Make a column two columns | Excel Programming |