How do I remove all special characters which don\'t fall under ASCII category in VBA?
These are some of the symbols which appear in my string.
<
Don't need to loop each character
Maybe late, but maybe it helps someone:
Public Function StripNonAsciiChars(ByVal InputString As String) As String
Dim i As Integer
Dim RegEx As Object
Set RegEx = CreateObject("VBScript.RegExp")
With RegEx
.Global = True
.MultiLine = True
.IgnoreCase = True
.Pattern = "[^\u0000-\u007F]"
StripNonAsciiChars = Application.WorksheetFunction.Trim(RegEx.Replace(InputString, " "))
End With
End Function