How to remove " via vba ?

  • Thread starter Thread starter Ed Dror
  • Start date Start date
E

Ed Dror

Hi there,

I have a function that remove almost all wildcards

Public Sub Clean()
For Each Cell In Selection

Cell.Value = Replace(Cell.Value, "~", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "@", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "^", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "&", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "*", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "(", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, ")", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "-", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, ",", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, ".", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "/", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "!", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, ";", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "#", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "'", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "?", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, ":", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "'", " ", 1, 1, vbTextCompare)
Cell.Value = Replace(Cell.Value, "-", " ", 1, 1, vbTextCompare)

Next Cell
End Sub

How to include the " into this function ? ( yes, I can use the ~" with find
and replace manually )

Thanks,

Ed Dror
Email: (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top