Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to remove " via vba ?
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: |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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: |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007: top of screen "File Name [Group]", how to remove [Grou | Excel Discussion (Misc queries) | |||
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string | Excel Worksheet Functions | |||
How correct (or remove) "Compile error in hidden module: DistMon" | Excel Discussion (Misc queries) | |||
macro to remove a named range always called "database" & if possib | Excel Programming |