Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is there a "replace" or "Substitute" command in Excel's VB?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Is there a "replace" or "Substitute" command in Excel's VB?

tanast,

try

sString = Replace(sString, " ", "")

regards,

JohnI

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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


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
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string Raja Mahendiran S Excel Worksheet Functions 6 May 12th 10 09:10 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 12:06 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"