Is there a "replace" or "substitute" command in Excel's VB?

  • Thread starter Thread starter tanast
  • Start date Start date
T

tanast

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
 
Hi

Select range of more as 1 cells, or when you want replacements for entire
worksheet then any single cell.
From Edit menu select Replace
Into 'Find wath' field enter a space, into 'Replace with' field nothing
ReplaceAll
 
tanast,

You confused a few of us by posting in ".misc"

try
sString = Application.Substitute(sString, " ", "")

and see my other suggestion under ".programming"

regards,

JohnI

sString = Application.Substitute(sString, " ", "")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top