Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
How copy text from one table to insert in another (w/o tbl structu
I wanted to copy data from one table to another with the same table structure
(same number of rows/columns). When I selected and copied the text from the first table and then inserted it into the other, the entire table structure was included in the copy. How can I prevent that -- i.e., how can I get only the text to insert into the target table? Thanks. |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
How copy text from one table to insert in another (w/o tbl structu
I just want to clarify that I meant that the 2 tables had the same
'structure' from the get-go and that I wanted simply to transfer 'text' from the second to the first. My problem was that I could not find a way to transfer *only* the text. When I inserted what I thought was only text in the second table, all the table structure from the first table was also inserted along with it -- making a mess. "mkraft" wrote: I wanted to copy data from one table to another with the same table structure (same number of rows/columns). When I selected and copied the text from the first table and then inserted it into the other, the entire table structure was included in the copy. How can I prevent that -- i.e., how can I get only the text to insert into the target table? Thanks. |
#3
Posted to microsoft.public.word.tables
|
|||
|
|||
How copy text from one table to insert in another (w/o tbl structu
The following code in a macro will copy the content from the first table in
a document to the second table: Dim Source As Table, Target As Table Dim i As Long, j As Long Dim crange As Range Set Source = ActiveDocument.Tables(1) Set Target = ActiveDocument.Tables(2) With Source For i = 1 To .Rows.Count For j = 1 To .Columns.Count Set crange = .Cell(i, j).Range crange.End = crange.End - 1 Target.Cell(i, j).Range.Text = crange.Text Next j Next i End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "mkraft" wrote in message ... I wanted to copy data from one table to another with the same table structure (same number of rows/columns). When I selected and copied the text from the first table and then inserted it into the other, the entire table structure was included in the copy. How can I prevent that -- i.e., how can I get only the text to insert into the target table? Thanks. |
#4
Posted to microsoft.public.word.tables
|
|||
|
|||
How copy text from one table to insert in another (w/o tbl structu
Or if you copied say 2×3 cells to the clipboard, you'd need to select 2×3
cells first before you paste into the new table (... and create the new cells beforehand if necessary). Haven't tried it now, but that has worked for me in the past, and it is a bit faster than transferring the individual cell contents. Regards, Klaus "Doug Robbins - Word MVP" wrote: The following code in a macro will copy the content from the first table in a document to the second table: Dim Source As Table, Target As Table Dim i As Long, j As Long Dim crange As Range Set Source = ActiveDocument.Tables(1) Set Target = ActiveDocument.Tables(2) With Source For i = 1 To .Rows.Count For j = 1 To .Columns.Count Set crange = .Cell(i, j).Range crange.End = crange.End - 1 Target.Cell(i, j).Range.Text = crange.Text Next j Next i End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "mkraft" wrote in message ... I wanted to copy data from one table to another with the same table structure (same number of rows/columns). When I selected and copied the text from the first table and then inserted it into the other, the entire table structure was included in the copy. How can I prevent that -- i.e., how can I get only the text to insert into the target table? Thanks. |
#5
Posted to microsoft.public.word.tables
|
|||
|
|||
How copy text from one table to insert in another (w/o tbl structu
I find that this works well pasting from Excel to Word but often fails
pasting Word to Word. Go figure. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "Klaus Linke" wrote in message ... Or if you copied say 2×3 cells to the clipboard, you'd need to select 2×3 cells first before you paste into the new table (... and create the new cells beforehand if necessary). Haven't tried it now, but that has worked for me in the past, and it is a bit faster than transferring the individual cell contents. Regards, Klaus "Doug Robbins - Word MVP" wrote: The following code in a macro will copy the content from the first table in a document to the second table: Dim Source As Table, Target As Table Dim i As Long, j As Long Dim crange As Range Set Source = ActiveDocument.Tables(1) Set Target = ActiveDocument.Tables(2) With Source For i = 1 To .Rows.Count For j = 1 To .Columns.Count Set crange = .Cell(i, j).Range crange.End = crange.End - 1 Target.Cell(i, j).Range.Text = crange.Text Next j Next i End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "mkraft" wrote in message ... I wanted to copy data from one table to another with the same table structure (same number of rows/columns). When I selected and copied the text from the first table and then inserted it into the other, the entire table structure was included in the copy. How can I prevent that -- i.e., how can I get only the text to insert into the target table? Thanks. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to insert a linked copy of a text into the same word document. | Microsoft Word Help | |||
Copy and paste doesn't insert copied text, it inserts screen cap | Microsoft Word Help | |||
Copy text from word document to cell of a table | Tables | |||
How to copy a Table with all the text in it. | New Users | |||
Toolbar option available for TABLE>INSERT>TABLE to enclose text into a table? | New Users |