Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    L.A., California, USA
    Posts
    267
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Pasting rows between tables (Word 2000)

    I most always have trouble pasting rows from one table into another table. I'm careful to make sure both tables have the same number of columns, but when I paste in the new rows, they don't conform to the width of the columns in the receiving table. Is there an easy way to get this to work?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Pasting rows between tables (Word 2000)

    <P ID="edit" class=small>(Edited by jscher2000 on 18-Nov-05 23:39. )</P>Starting in Word 2000, I believe the default is to let the content stretch the size of cells. Unless you turn this off and rigorously set all the column widths, it would be a miracle to find two tables with the same layout. One way to try to get them the same is to save a blank table of the correct layout as an AutoText entry, and use that to create all your tables for that particular situation.

    Added: Actually, if you are copying, say, three rows from the source table, and you select three rows in the destination table, Word may paste the contents (and font/paragraph formatting) without disturbing the layout. I don't keep careful tabs on exactly when Word does which behavior, but you could experiment with this.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    L.A., California, USA
    Posts
    267
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Re: Pasting rows between tables (Word 2000)

    I tried several ways of pasting the rows but the only thing that seems to work is this:

    1. Create blank rows in the receiving table
    2. Select the rows in the table you're copying from, put them on clipboard
    3. Do a Paste Special, Unformatted into the blank rows in the receiving document

    The two problems with this are (1) any attributes in the pasted rows are lost, and (2) any formatting in the columns of the receiving table (e.g., centering) is lost. Also, it's inconvenient to have to create blank rows in the receiving table first, especially when you have a large number of rows to copy (152 in this case).

    I find it hard to believe that Word doesn't have some easy way of doing this kind of thing without jumping through these hoops and losing formatting like this. This is a common operation and an important feature for a word processing program to have. The paralegals in my law firm do nothing but this kind of work (putting mammoth tables together from different sources). WordPerfect does this seamlessly and I would be shocked if Word doesn't have a way to do it as well.

    Can anyone help clear this up?

    (Thanks for your reply, Jefferson.)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Pasting rows between tables (Word 2000)

    Rummaging in my code archive, I came upon the following macro. It assumes that
    a) all tables in the document have the same number of columns.
    [img]/forums/images/smilies/cool.gif[/img] all cells in a column in one table have the same width.
    It will make the column widths of all tables in the document the same as those in the first table in the document.
    Perhaps you can use it. You could copy the source and destination table to a temporary document if you don't want all tables to have the same column widths in the document you're working with.

    Sub FixColWidths()
    Dim aTable As Table
    Dim ColWidths() As Single
    Dim ColSpace As Single
    Dim i As Integer, n As Integer, j As Integer
    Application.ScreenUpdating = False
    Set aTable = ActiveDocument.Tables(1)
    n = aTable.Columns.Count
    ReDim ColWidths(1 To n)
    For i = 1 To n
    ColWidths(i) = aTable.Columns(i).Width
    Next i
    ColSpace = aTable.Rows.SpaceBetweenColumns
    For j = 2 To ActiveDocument.Tables.Count
    Set aTable = ActiveDocument.Tables(j)
    For i = 1 To n
    aTable.Columns(i).Width = ColWidths(i)
    Next i
    aTable.Rows.SpaceBetweenColumns = ColSpace
    Next j
    Set aTable = Nothing
    Application.ScreenUpdating = True
    End Sub

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    L.A., California, USA
    Posts
    267
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Re: Pasting rows between tables (Word 2000)

    Thank you, Hans. I still can't believe there's not an easier solution to this.

    Russ

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Pasting rows between tables (Word 2000)

    There are different ways to paste content in. I don't normally have the same problem as you and I often paste cells into existing tables specifically to realign the cell widths to the target table. I haven't got Word 2000 on the current computer but I certainly had less table issues with that version than I do with the later versions.

    In the later versions of Word eg 2002/2003 I have noticed that you don't want to copy the final cell of a table as it contains hidden information that may cause the inserted cells to be a separate embedded table and not merge into the one table. I avoid this by adding a new row at the bottom of the copied table and not including that row in the copy.

    Once I have my copied cells in the clipboard then I go to the target table and put my (collapsed) selection cursor in the cell where I want my paste to start. A simple paste then works nicely for me. Note that selecting cells before doing the paste can yield different results.

    Is there local formatting in your tables? Are the tables set to resize automatically to the content? Perhaps these factors are clouding your experience.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #7
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    L.A., California, USA
    Posts
    267
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Re: Pasting rows between tables (Word 2000)

    Andrew, the funny thing is, I don't always have a problem pasting rows from one table to another--just sometimes. I haven't been able to tell what the problem is when it doesn't work.

    What do you mean "collapsed" selection cursor? When you say "simple paste," do you mean just a regular paste or Paste Special?

    The column widths are all set to resize automatically to the content. By "local formatting" I assume you mean additional paragraph formatting not found in the styles. Nope, none of that.

    As I mentioned in my reply to Jefferson, the only thing that worked in this case was to first select the proper number of rows in the target table and then do a Paste Special, Unformatted. I'm not at work right now and so don't have the document handy, but as I recall, when I did a Paste Special, Unformatted without first selecting rows in the target table, the entire paste was put into the cell where my cursor was.

    Also, when I did a regular paste with rows selected in the target table, the columns of the insertion did not conform to the column widths in the target table.

    Thanks for the tip about not copying the final cell of a table in later versions of Word.

  8. #8
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Pasting rows between tables (Word 2000)

    Russ,

    I normally get away with a regular paste but have had rare occasions when the column widths don't match. I have never felt the need to fully work out the issues though as the fix is usually quick enough because I have table formatting macros in my templates. Can you post a sample doc with a couple of tables that doesn't work for you so we can test it ourselves and see if there is something peculiar with those tables.

    When posting table cells I would only very rarely use Paste Special and then only if I don't want a table structure in the paste.

    Is copying between files an issue or is this within a single file?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  9. #9
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    L.A., California, USA
    Posts
    267
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Re: Pasting rows between tables (Word 2000)

    Andrew,

    I'm not at work today, so I'll try to post a document with samples of both tables tomorrow. The two tables are in separate documents. The general problem I'm facing in all of this is that at my law firm, the tables are created by different people (sometimes paralegals, sometimes secretaries, sometimes attorneys), so I as a word processor have to deal with all kinds of formatting, good and bad.

    Thanks for offering to take a look.

    Russ

  10. #10
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Pasting rows between tables (Word 2000)

    I'm using Word 2002 and just did the following:

    1. I hit the "New" button to give myself a new blank document.
    2. I used the Insert Table button to insert a 3x3 table.
    3. I went to the end of the table (outside it), moved down a couple paragraphs, and again used the Insert Table button to insert a 2nd 3x3 table.
    4. I clicked/dragged the boundary between the 1st & 2nd columns of the 1st table to create unequal column widths.
    5. I double-clicked at the left table boundary to select the 2nd row of the 1st table, and then copied it to the clipboard.
    6. I clicked into the first cell of the 2nd row of the 2nd table (collapsed IP).
    7. I did a normal paste.

    Result: The 2nd row (of 4 rows) in the 2nd table has different column widths than the other 3 rows.

    (One more reason to miss WordPerfect, say I.)

  11. #11
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Pasting rows between tables (Word 2000)

    I can see what you have done that is different to the way I do it. Your step 5 selection includes the end of row marker to the right of the table - I presume this is where the rows cell width information is stored.

    Try modifying step 5 to select the CELLS by dragging across the three cells and not including the end of row marker. Now when you copy this into the table above you will get the same column widths because you will be copying into existing cells (not inserting new rows). This means in practice that you may need to insert a new blank row to avoid overwriting existing content. The quickest way to do this is to put your cursor at the end of cell marker location and press Enter.

    New rows get added automatically at the bottom of the table if there are not enough rows to cater for your clipboard contents.

    I know this is not going to change your opinion of Word vs WP but I think this shows good flexibility in the software depending on what was in your clipboard and I still think that Microsoft got it right.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  12. #12
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Pasting rows between tables (Word 2000)

    Thanks for the tip. That works reasonably well -- although, as you noted, it overwrites the existing row in the target table, so you first have to add a new empty row to the target table (in the desired location) that you can paste over.

  13. #13
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    L.A., California, USA
    Posts
    267
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Re: Pasting rows between tables (Word 2000)

    Andrew and st3333ve,

    Sorry for not getting back until now. Because of the Thanksgiving holiday week, some of our staff is on vacation and I haven't had a moment to reply.

    In the meantime, Andrew, I tried your suggestion of not including the end-of-row marker when selecting the rows to be copied. It worked!! Of course I did have to create enough blank rows in the receiving table to accommodate the rows I was copying, but the columns in the copied rows conformed to those in the receiving table. Thanks for that great solution.

    It makes sense that the row formatting would be stored in the end-of-row marker given Word's convention of putting the formatting at the end of a structure (paragraph mark for a paragraph, trailing section break for a section, etc.). I've also heard of solving some document-corruption problems by selecting the entire document except for the final paragraph mark and pasting to a new document. I've never tried that myself, however.

    Although it seems kind of moot, I've attached a document with the two tables as you suggested, Andrew. Let me know if you find anything odd in the formats.

    Both of you guys have used the term "collapsed" when talking about the cursor or insertion point. What does that mean?

    Russ
    Attached Files Attached Files

  14. #14
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Pasting rows between tables (Word 2000)

    "Collapsed" just means nothing is selected -- i.e. that the "Selection" is an IP (insertion point).

    The reference in my previous post to a "collapsed IP" arguably belongs in the Dept. of Redundancy Dept.

  15. #15
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Pasting rows between tables (Word 2000)

    Russ, I've had a look at your file and there doesn't appear to be anything special about your formats. I guess your issue was just in the way you were selecting the cells for copying.

    Collapsed selection is just stressing that there is nothing currently selected in the file - just a flashing cursor. The opposite of this is an 'extended selection' where something is actually selected (eg by a click and drag).
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •