How do I extract just the text portion of a column? For example if column
contains:
"123 abcd", how do I get just the "abcd" in a new column?
How to do it depends on how close to reality your example is.
If the text portion is always the last word, then a simple formula:
=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99))
On the other hand, if letters and digits can be interspersed throughout the
string: e.g.
123a6bc789d
then a UDF might be more appropriate.
You also need to specify what you want to do with characters that are neither
letters nor digits. e.g: <space>; punctuation; pluses and minuses, etc.
To enter this User Defined Function (UDF), <alt-F11> opens the Visual Basic
Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.
To use this User Defined Function (UDF), enter a formula like
=GetText(a1)
in some cell.
As written, this UDF will eliminate everything that is not a letter in the
standard English alphabet; but the pattern can be easily modified.
=======================================
Option Explicit
Function GetText(s As String) As String
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Pattern = "[^A-Za-z]" 'removes any non-letters
re.Global = True
GetText = re.Replace(s, "")
End Function
=====================================
--ron