Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace a character with a hard return

Status
Not open for further replies.

Joe1010

Programmer
Dec 11, 2006
49
US
I’m using Excel 2002
Is it possible to replace a special character (or a combination of mutable) with a hard return? (Alt Enter)

Thanks
 
The hard return character you refer to can be 'typed' into Excel's Replace dialog box by holding down the Alt key as you type 010 on the Number pad.

The same method can be used for other characters as long as you know their character codes.
 
Thanks
It worked. However, if the value of the cell is over a limit of characters, it does not work. Any solution.
 
No, No, it does not work. Sorry.

Let me clarify the question, I would like to add a hard return every place I have this value
---

How do I enter the Alt Enter in the “replace with” field?

Tanks
 
Line Feed and Carriage Return

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Line feed
Carriage Return
However just try the suggestions and find out.



Gavin
 
I very appreciate your help. I got it to work. Can anyone explain the different between Line feed and Carriage Return

Thanks
 
This is a hold over from typewriter and teleprinter days.

A line feed is exactly that. It means move the printer roller one line "up".

A carriage return is the movement of the print head back to the far left position.

They are different actions. Yet the issue is this simple question.

If you make a newline, do you, or do you not, move the focus (the cursor on computers, the print head on printers) to the START of the new line? The question is what defines line termination?

In the early days applications had to talk directly to hardware, and printers could not move the head to the left position in one character. So CR/NUL charcters were sent to move the head to the left, and were ignored. So the sequence was CR + LF.

On older systems there could be conflict between Unix text files, Apple text files, and PC text files. Mac text files did NOT translate well to Windows, even as ASCII text files. For example, files originating on Unix or Apple Macintosh systems could appear as a single long line on a Windows system. PC looked for both a CR and LF control code, Unix amd Apples did not.

Nevertheless, on the PC, a CR is internally added to a LF.
Code:
Selection.Range.InsertAfter Text:=vbLf
Selection.Range.InsertAfter Text:=vbCrLf
have identical effects. The returned ASCII character for the Selection with EITHER of those instructions will be 13.

In Word though it can get a little odd when dealing with these inside a table cell. The termination code is actually a meld of Chr(13) and Chr(7). 7 is BELL. This is the control code for the "Ding" that typewriters used to do when then reach their physical end and HAD to terminate. It was a physical sound given to the the typist to tell them to yank the line feed/carriage return.

I am not familiar enough with Excel to comment.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top