Delete/Replace Newling Charecter from all cells.

K

KM

How do search entire worksheet for newline charecter and
1) replace it with another charecter (say ~) or/and
2) delete permanently

Thanks in advance.
KM
 
R

Rob Bovey

KM said:
How do search entire worksheet for newline charecter and
1) replace it with another charecter (say ~) or/and
2) delete permanently

Both can be accomplished the same way, with the following line of code:

ActiveSheet.UsedRange.Replace What:=vbLf, Replacement:="~"

Tp replace the newline character (vbLf) with another character, just put
whatever character you want to replace it with in the Replacement:=
argument. To completely remove all vbLf characters, simply use an empty
string in the Replacement:= argument.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

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