Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Split text into columns
Has anyone got any code that would split a name in one cell into three
columns. I have seen somewhere how to look for the space and so split it up! An example of my data is: Rev Christopher Dent |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Split text into columns
I assume your names are in Col. A and you want the First Name in Col.B,
Middle Name in Col.C, and Last Name in Col.D. This will do it for you. Sub SplitNames() Dim rng As Range For Each rng In Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row) Range(Cells(rng.Row, rng.Column + 1), Cells(rng.Row, rng.Column + 3)) = Split(rng, " ") Next rng End Sub Hope this helps! If so, let me know, click "YES" below. -- Cheers, Ryan "Mervyn Thomas" wrote: Has anyone got any code that would split a name in one cell into three columns. I have seen somewhere how to look for the space and so split it up! An example of my data is: Rev Christopher Dent . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Split Text in a Cell (4 columns) | Excel Programming | |||
Trim text and split across three columns | Excel Discussion (Misc queries) | |||
Insert columns and split text | Excel Programming | |||
split text , insert to columns | Excel Discussion (Misc queries) | |||
How do I split 16 char text 'XX XXX= +. X' into 16 columns | Excel Discussion (Misc queries) |