Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tod tod is offline
external usenet poster
 
Posts: 114
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i add 2 columns to make the answer apper on the 3rd column merrymeet2u Excel Worksheet Functions 4 January 31st 06 03:59 PM
Macro to Combine 2 columns to make one column without merging JRM Excel Discussion (Misc queries) 1 December 31st 05 08:27 PM
How can I make columns within one column? CC New Users to Excel 1 October 5th 05 02:12 PM
How do I make a column in Excel into two columns for only A3-A8 ruffles the cat Excel Discussion (Misc queries) 1 June 23rd 05 01:25 PM
Make a column two columns Ron de Bruin Excel Programming 0 May 6th 04 03:52 PM


All times are GMT +1. The time now is 01:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"