New_Alex
asked on
VBA, Remove Non AlphaNumeric Characters from A string
Hi people. Is it there any better way to write the below Function?
Thanks
Function AlphaNumerize(anyString As String) As String
AlphaNumerize = Replace(anyString, "-", "")
AlphaNumerize = Replace(AlphaNumerize, "(", "")
AlphaNumerize = Replace(AlphaNumerize, ")", "")
AlphaNumerize = Replace(AlphaNumerize, "_", "")
AlphaNumerize = Replace(AlphaNumerize, "\", "")
AlphaNumerize = Replace(AlphaNumerize, "/", "")
AlphaNumerize = Replace(AlphaNumerize, "<", "")
AlphaNumerize = Replace(AlphaNumerize, ">", "")
AlphaNumerize = Replace(AlphaNumerize, "=", "")
End Function
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
New_Alex,
Glad to help! If you have not already done so, I would really appreciate it if you could please return to my article
https://www.experts-exchange.com/Programming/Languages/Visual_Basic/A_1336-Using-Regular-Expressions-in-Visual-Basic-for-Applications-and-Visual-Basic-6.html
and click 'Yes' for the 'Was this helpful?' voting.
Patrick
Glad to help! If you have not already done so, I would really appreciate it if you could please return to my article
https://www.experts-exchange.com/Programming/Languages/Visual_Basic/A_1336-Using-Regular-Expressions-in-Visual-Basic-for-Applications-and-Visual-Basic-6.html
and click 'Yes' for the 'Was this helpful?' voting.
Patrick
ASKER