Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bob
 
Posts: n/a
Default how to preserve paragraph breaks in pasted text?

When I paste text copied from a Word document into an Excel cell, Excel
breaks the pasted text into separate cells according to the paragraph breaks
contained in the pasted text. However, I would like to preserve those
paragraph breaks and keep all the pasted text in the same cell.

I realize that when entering text in a cell, I must insert Alt+Return to get
a paragraph break to stay in the cell. But there doesn't seem to be a way to
force pasted text to stay in a single cell when it contains paragraph breaks.

Any advice would be most appreciated.
  #2   Report Post  
Martin P
 
Posts: n/a
Default

In Word, change the hard returns to dollar signs, using Edit, Replace.
Copy the cells to Excel.
In Excel, run this macro:
Sub dollartobreak()
Cells.Replace What:="$", Replacement:="" & Chr(10) & "", LookAt:=xlPart,
SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End Sub

"Bob" wrote:

When I paste text copied from a Word document into an Excel cell, Excel
breaks the pasted text into separate cells according to the paragraph breaks
contained in the pasted text. However, I would like to preserve those
paragraph breaks and keep all the pasted text in the same cell.

I realize that when entering text in a cell, I must insert Alt+Return to get
a paragraph break to stay in the cell. But there doesn't seem to be a way to
force pasted text to stay in a single cell when it contains paragraph breaks.

Any advice would be most appreciated.

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Manually:

If your cells in your word table contain paragraph mark or linebreak characters,
then excel will bring them over as separate cells.

One way around it is to convert those paragraph marks & linebreaks to unique
characters, then copy|paste and then convert them back to linefeeds.

I like this technique (inside a copy of the word file):
Select your table.
Edit|replace|Special (show More if required)
Find what: (paragraph mark under Special button)
replace with: $$$$$ (if $$$$$ doesn't appear in the table)
replace all

Same thing with Manual Line break (from under Special).

Now copy the table into Excel.

Edit|Replace
Replace what: $$$$$
Replace with: ctrl-j
replace all.

Don't forget to close the word document without saving (or hit undo as many
times as necessary).

Bob wrote:

When I paste text copied from a Word document into an Excel cell, Excel
breaks the pasted text into separate cells according to the paragraph breaks
contained in the pasted text. However, I would like to preserve those
paragraph breaks and keep all the pasted text in the same cell.

I realize that when entering text in a cell, I must insert Alt+Return to get
a paragraph break to stay in the cell. But there doesn't seem to be a way to
force pasted text to stay in a single cell when it contains paragraph breaks.

Any advice would be most appreciated.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default how to preserve paragraph breaks in pasted text?

A quick way of doing this if you only have a small amount of text to paste is
to copy it from Word and paste it into the Formula Bar in Excel instead of
into the cell. I have tried this and Excel converts even hard paragraph
breaks in Word into soft paragraph breaks in Excel, which is what we want.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default how to preserve paragraph breaks in pasted text?

This can also be solved by double-clicking into a cell and pasting (ctrl-v)
your copied text into it, this will work as well.

"Bob" wrote:

When I paste text copied from a Word document into an Excel cell, Excel
breaks the pasted text into separate cells according to the paragraph breaks
contained in the pasted text. However, I would like to preserve those
paragraph breaks and keep all the pasted text in the same cell.

I realize that when entering text in a cell, I must insert Alt+Return to get
a paragraph break to stay in the cell. But there doesn't seem to be a way to
force pasted text to stay in a single cell when it contains paragraph breaks.

Any advice would be most appreciated.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not all pasted text appears in cells cjswift Excel Discussion (Misc queries) 1 August 8th 05 03:43 PM
Hard breaks in text to soft breaks in Excel tbailey Excel Discussion (Misc queries) 6 July 28th 05 02:35 AM
How do I add a make a new paragraph in a text cell? bearntrail Excel Discussion (Misc queries) 1 July 5th 05 10:15 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
How do I add (auto text) to a paragraph? Lisa Nelson Excel Worksheet Functions 1 May 4th 05 04:07 PM


All times are GMT +1. The time now is 09:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"