Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Split text in a column to multiple columns

Can I split text in a column like the example below into
three columns?
Column = Column1 Column2 Column3
1 1234 John W. Doe = 1 1234 John W. Doe

Thanks,
milo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Split text in a column to multiple columns

Okay this isn't the most elegant code, but I'm still learning, and will
always welcome tips on way to make my code more efficient. This should
work assuming your data is in column A.


Columns("B:E").Select
Selection.insert Shift:=xlToRight
Columns("A:A").Select
Application.DisplayAlerts = False
Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True,
Tab:=False, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False,
FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1),
Array(5, 1))
Application.DisplayAlerts = True
Columns("C:C").Select
Selection.insert Shift:=xlToRight
Range("C1").Select
Do
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[1],"" "",RC[2],""
"",RC[3])"
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell.Offset(0, -2) = ""
Range("c:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Columns("D:F").Select
Selection.delete Shift:=xlToLeft



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Split text in a column to multiple columns

the easiest way is to highlight all the colums and then go
to the data menu and go to 'text to columns' and then hit
next and put the line where you want to seperate them.

-----Original Message-----
Can I split text in a column like the example below into
three columns?
Column = Column1 Column2 Column3
1 1234 John W. Doe = 1 1234 John W. Doe

Thanks,
milo
.

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 text into multiple columns using a common delimiter buffgirl71 Excel Discussion (Misc queries) 4 May 21st 23 07:43 PM
split one column to multiple columns Greg Excel Worksheet Functions 4 December 14th 09 08:13 PM
split one column into multiple columns SandyDi Excel Discussion (Misc queries) 2 September 25th 09 12:34 AM
Split numbers and text from 1 column into 2 columns Kevin K[_2_] Excel Discussion (Misc queries) 0 April 25th 08 06:55 PM
text from one column into multiple columns Jeff Brown Excel Discussion (Misc queries) 6 December 22nd 04 10:07 PM


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

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"