Replace return of line by a space in VBA

K

keawee

Hello,

I would like to have your assistance In VBA

I have my data which starts in D5 until D156. In each cell, I have an
address and in several addresses, I have a return to the line.

My question. It is possible to detect in a string a return to the line
in VBA and to replace it by a space.

I have also another problem. In the address, I have some times several
space between two words, is it possible to count the number of space
between two words in if there is more than one space, then to remove
the others not to have but one.

Thanks for your help

Keawee
 
B

Bob Phillips

Keawee,

Try this

Replace(ActiveCell.Value, Chr$(10), " ")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Top