Remove all special characters and spaces

by PRanesh 2014-05-31 10:58:14

Alt+F11 - Insert - Module - Paste it in.

Function removeSpecial(sInput As String) As String
    Dim sSpecialChars As String
    Dim i As Long
    sSpecialChars = "/:*?""<>|"
    For i = 1 To Len(sSpecialChars)
        sInput = Replace$(sInput, Mid$(sSpecialChars, i, 1), " ")
    Next
    removeSpecial = sInput
End Function


You can add more special characters into the array if you wish.

Then in your cell, type: =SUBSTITUTE(removeSpecial(A1)," ","") 
1050
like
0
dislike
0
mail
flag

You must LOGIN to add comments