View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Colo Colo is offline
external usenet poster
 
Posts: 62
Default Is there a "replace" or "Substitute" command in Excel's VB?

Hi, you can also use "Substitute" as follows.

sString = "Hello World!"
sString = Application.WorksheetFunction.Substitute(sString, " ", "")

Note:Replace works on Excel 2000 and later version.


--
Kind Regards
Colo
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Colo of 'The Road of The Cell Masters' :)

URL:http://www.interq.or.jp/sun/puremis/...astersLink.htm


/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


wrote in message
...
Hi,

I was hoping someone could help me with a quick question.

Is there a command something like "substitute" or "replace"?

I basically want a command that will replace all instances of a
particular character with another character... For example, I'd like
to remove all the spaces from the string "hello there world" to make
it "hellothereworld".

Any help would be much appreciated.

Thanks