简体   繁体   中英

Need Macro for finding text inside the cell using excel

I need a macro OR Formula to find the alphabets in the cell,kindly do the needfull.

Input Output 521.03SS 522.05KS KS 520.32-EXS -EXS 03.200.01-ABC -ABC

i have to sort out the alphepets and "-"(Hypens) in excell.

looking for your answers....

There's probably many ways to achieve this. Here's a simple, brute-force method, that's easy to modify. Though technically, it doesn't find the alpha characters, it makes the digits go away.

Function noNumbers(ByVal cltext As String) As String

Dim mytext As String
mytext = Replace(cltext, "0", "")
mytext = Replace(mytext, "1", "")
mytext = Replace(mytext, "2", "")
mytext = Replace(mytext, "3", "")
mytext = Replace(mytext, "4", "")
mytext = Replace(mytext, "5", "")
mytext = Replace(mytext, "6", "")
mytext = Replace(mytext, "7", "")
mytext = Replace(mytext, "8", "")
mytext = Replace(mytext, "9", "")
noNumbers = mytext

End Function

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM