Text to columns

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I have data in the form of 2.00 x 3.00 x 5.00 CRS. I want to seperate the
CRS into a new column. Sometimes there is only 2 values before crs such as
2.00 x 4.00 CRS, but what I want to seperate is always last and always has a
space before it. Can anyone help?

Thanks
Bill
 
You have answered your question yourself.

Use the TEXT TO COLUMNS option.

When prompted for fixed width or delimited by, select delimited by. On the
next selection screen specify "space".
On the next selection screen, you can always decide which columns to "SKIP".

That should help you get the CRS in a new column, or even avoid getting CRS
(if you use SKIP option).
 
Yes thanks you, but I want this in a macro and there will be a column with
many rows of similar data.
 
I have data in the form of 2.00 x 3.00 x 5.00 CRS. I want to seperate the
CRS into a new column. Sometimes there is only 2 values before crs such as
2.00 x 4.00 CRS, but what I want to seperate is always last and always has a
space before it. Can anyone help?

Thanks
Bill

This UDF will return the last word in a string:

====================
Function LastWord(str As String) As String
LastWord = Split(str)(UBound(Split(str)))
End Function
=======================

If there might be trailing spaces, then:

==========================
Function LastWord(str As String) As String
LastWord = Split(Trim(str))(UBound(Split(Trim(str))))
End Function
==========================
--ron
 
Back
Top