Split only the Names

niladri20052006

Board Regular
Joined
Dec 3, 2010
Messages
121
Hi All,

I have a list as follows

Long Beach 492,682
Los Angeles 3,792,621
Glendale 207,303
Santa Clarita 177,150
Yucca Valley
Torrance 149,111

I have 500+ data in this way. I want only the Text not the numbers like Long Beach , Los Angeles, Glendale...

Is there any better way to do that?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
=left(a1,min(find({"0","1","2","3","4","5","6","7","8","9"},a1&"0123456789"))-1)
 
Upvote 0
UDF.
Set reference: Tools -> References -> Microsoft VBScript Regular Expressions 5.5

Code:
Function ExtractText(Str As String) As String

    ' Set reference: Tools -> References -> Microsoft VBScript Regular Expressions 5.5
    
    Dim re As New RegExp
    Application.Volatile
    
    With re
        .Global = True
        .Pattern = "[\D]+"
    End With
    
    ExtractText = Trim(re.Execute(Str)(0))
    
End Function
 
Upvote 0
Or you could use late binding to avoid all the rigmarole with setting the reference

Code:
Function ExtractText(Str As String) As String
    With CreateObject("VBScript.RegExp")
        .Global = True
        .Pattern = "[\D]+"
        ExtractText = Trim(.Execute(Str)(0))
    End With
End Function
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top