Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
mkraft mkraft is offline
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.word.tables
mkraft mkraft is offline
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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   Report Post  
Posted to microsoft.public.word.tables
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default 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   Report Post  
Posted to microsoft.public.word.tables
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert a linked copy of a text into the same word document. Matthias Microsoft Word Help 3 October 26th 06 10:28 AM
Copy and paste doesn't insert copied text, it inserts screen cap jeffhi Microsoft Word Help 5 August 24th 06 06:22 PM
Copy text from word document to cell of a table [email protected] Tables 1 October 3rd 05 04:19 AM
How to copy a Table with all the text in it. L. Peter Stacey New Users 1 June 16th 05 01:24 AM
Toolbar option available for TABLE>INSERT>TABLE to enclose text into a table? StargateFan New Users 5 January 29th 05 11:10 PM


All times are GMT +1. The time now is 04:14 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"