Find and Replace Text with CarriageReturn

  • Thread starter Thread starter RickT
  • Start date Start date
R

RickT

I get a data extract that includes "\n" text. I would
like to replace with CarriageReturn using a macro. I
cannot seem to make the normal Find and Replace work for
this.
 
Rick

one way:

Cells.Replace _
What:="/n", _
Replacement:=Chr(10), _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False

Regards

Trevor
 
RickT

Try

Sub ReplaceSlashN()
'
''
ActiveSheet.UsedRange.Replace What:="/n", Replacement:="" & Chr(10)
& "", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub
 
I was able to do it manually:

I selected the range and hit Edit|replace
find what: \n
replace with: hit and hold the altkey and type 0010 from the number
keypad--not above QWERTY.

It may look like nothing got entered, but try it anyway.
 
Back
Top