Aleksei Nikolaevich
Aleksei Nikolaevich

Reputation: 325

How to get rid of all special characters using vba

My data contains #, / , ' etc. How can I get rid of all those things and substitute them with "" . I want to apply this to Sheet1 all cells ?

Upvotes: 0

Views: 133

Answers (1)

mwolfe02
mwolfe02

Reputation: 24207

Sub RemoveSpecChars()
    Dim Token As Variant
    For Each Token In Array("-", "\", "#")  'etc.
        Sheet1.UsedRange.Replace Token, ""
    Next Token
End Sub

Upvotes: 2

Related Questions