ALT+F11 -> Insert -> Module
Function DigitsOnly(S As String) As String
Dim X As Long
DigitsOnly = Replace(S, " ", "")
If DigitsOnly Like "+91*" Then DigitsOnly = Mid(DigitsOnly, 4)
For X = 1 To Len(DigitsOnly)
If Mid(DigitsOnly, X, 1) Like "[!0-9]" Then Mid(DigitsOnly, X) = " "
Next
DigitsOnly = Replace(DigitsOnly, " ", "")
End Function
=DigitsOnly(A1)
(протестовано в Office 2007)
Немає коментарів:
Дописати коментар