Delete/Replace Newling Charecter from all cells.

  • Thread starter Thread starter KM
  • Start date Start date
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
 
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 *
 
Back
Top