View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default How to remove " via vba ?

Cell.Value = Replace(Cell.Value, """", " ", 1, 1, vbTextCompare)

--
Tim Williams
Palo Alto, CA


"Ed Dror" wrote in message
...
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: