Replace return of line by a space in VBA

  • Thread starter Thread starter keawee
  • Start date Start date
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
 
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)
 
Back
Top