Use the function AlphaOnly
to remove all non character instances. Anything that is not [a-z, A-Z]
will be scrubbed from string.
The macro Alpha
aims to loop through some predetermined range and will apply the value generated by the formula. The range to-be-looped in example is A1:A10
and will need to be adjusted accordingly.
The function needs to be pasted in a Module
to run.
Option Explicit
Function AlphaOnly(strSource As String) As String
Dim i As Integer
Dim strResult As String
For i = 1 To Len(strSource)
Select Case Asc(Mid(strSource, i, 1))
Case 65 To 90, 97 To 122
strResult = strResult & Mid(strSource, i, 1)
End Select
Next
AlphaOnly = strResult
End Function
Sub Alpha()
Dim ws As Worksheet: Set ws = ThisWorkbook.Sheets("Sheet1") '<-- Update
Dim i As Range
For Each i In ws.Range("A1:A10") '<-- Update
i = AlphaOnly(i.Text)
Next i
End Sub
Function Source which has been slightly modified to fit OP needs.