Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Split Cell Across Two Columns

Showing alternates

Sub splitnames()
c = ActiveCell
findcomma = InStr(c, ",")
fand = InStr(c, "and")
x = Mid(c, findcomma + 1, fand - findcomma - 2) & " " & Left(c, findcomma -
1)
ActiveCell.Offset(, 1) = x
ActiveCell.Offset(, 2) = Right(c, Len(c) - fand - 2) & " " & Left(c,
findcomma - 1)
End Sub
'more than one
Sub splitnamesloop()
For Each c In Range("a2:a16")
findcomma = InStr(c, ",")
fand = InStr(c, "and")
'each line below is ONE line
c.Offset(, 1) = Mid(c, findcomma + 1, fand - findcomma - 2) & " " & Left(c,
findcomma - 1)
c.Offset(, 2) = Right(c, Len(c) - fand - 2) & " " & Left(c, findcomma - 1)
Next
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"CCarter" wrote in message
...
Is there a way for me to change:

Smith, John and Jane

to:

John Smith Jane Smith

Thanks in advance,
Cathy


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
split 1 column to 3 columns rckymtntim Excel Discussion (Misc queries) 2 January 7th 08 12:21 AM
how do i split names in to two columns jesse Excel Discussion (Misc queries) 0 June 21st 07 05:03 PM
How do I split a cell into multiple rows/columns? SKA Excel Discussion (Misc queries) 1 January 18th 06 12:04 AM
split column into 4 columns Jack Excel Discussion (Misc queries) 3 November 15th 05 08:27 PM
Can Columns be split? Armyman Excel Discussion (Misc queries) 3 March 21st 05 11:15 PM


All times are GMT +1. The time now is 12:12 AM.

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

About Us

"It's about Microsoft Excel"