Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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:




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007: top of screen "File Name [Group]", how to remove [Grou Lightjag Excel Discussion (Misc queries) 3 April 2nd 23 07:08 PM
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string Raja Mahendiran S Excel Worksheet Functions 6 May 12th 10 09:10 PM
How correct (or remove) "Compile error in hidden module: DistMon" wlfoote Excel Discussion (Misc queries) 1 June 6th 09 02:57 AM
macro to remove a named range always called "database" & if possib Todd F.[_2_] Excel Programming 9 July 25th 05 06:25 PM


All times are GMT +1. The time now is 02:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"