Book1 | ||||
---|---|---|---|---|
A | B | |||
2 | john17son1992born | johnsonborn | ||
3 | premkumar12from560077 | premkumarfrom | ||
4 | king0295of99theking | kingoftheking | ||
End |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2 | =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,0,""),1,""),2,""),3,""),4,""),5,""),6,""),7,""),8,""),9,"") |
Function Letters(s As String) As String
With CreateObject("VBScript.RegExp")
.Global = True
.Pattern = "[^a-zA-Z]"
Letters = .Replace(s, "")
End With
End Function
Excel Workbook | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | john17son1992born | johnsonborn | johnsonborn | ||
2 | premkumar12from560077 | premkumarfrom | premkumarfrom | ||
3 | king0295of99theking | kingoftheking | kingoftheking | ||
4 | john17#$so%]n1992born | johnsonborn | johnsonborn | ||
Sheet1 |
[SIZE=1]// Table1
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Text = Table.AddColumn(Source, "Text", each Text.Combine(List.RemoveItems(Text.ToList([Raw]),{"0".."9"})))
in
Text[/SIZE]
Function Letters(S As String, Optional RetainSpaces As Boolean) As String
Dim X As Long
For X = 1 To Len(S)
If Mid(S, X, 1) Like "[!A-Za-z" & Left(" ", -RetainSpaces) & "]" Then Mid(S, X) = Chr(0)
Next
Letters = Replace(S, Chr(0), "")
End Function