Sub RemoveNotAlphasNotNum() Dim Rng As Range Dim WorkRng As Range On Error Resume Next xTitleId = "KutoolsforExc...
Sub
RemoveNotAlphasNotNum()
Dim
Rng
As
Range
Dim
WorkRng
As
Range
On
Error
Resume
Next
xTitleId =
"KutoolsforExcel"
Set
WorkRng = Application.Selection
Set
WorkRng = Application.InputBox(
"Range"
, xTitleId, WorkRng.Address, Type:=8)
For
Each
Rng
In
WorkRng
xOut =
""
For
i = 1
To
Len(Rng.Value)
xTemp = Mid(Rng.Value, i, 1)
If
xTemp
Like
"[a-z.]"
Or
xTemp
Like
"[A-Z.]"
Or
xTemp
Like
"[0-9.]"
Then
xStr = xTemp
Else
xStr =
" "
End
If
xOut = xOut & xStr
Next
i
Rng.Value = xOut
Next
End
Sub
"
Actualy, I want only alphabet so I remove these command "Or xTemp Like "[0-9.]. All unwanted character will be replaced with "white space"
COMMENTS