Results 1 to 5 of 5

Macro to copy worksheet into word

Threaded View

  1. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641
    Hi again Pete,

    Here's a cheap & cheerful way of accommodating the table on a single sheet. The macro routine adjusts the top & bottom margins and the table row height so that all of the information fits on a single sheet.

    Just use the following for the "With appWord / End With" chunk of my previous code:

        With appWord
            .Documents.Add
            .Selection.Paste
            .ActiveDocument.PageSetup.BottomMargin = .CentimetersToPoints(2)
            .ActiveDocument.PageSetup.TopMargin = .CentimetersToPoints(2)
            .ActiveDocument.Tables(1).Rows.HeightRule = 2
            .ActiveDocument.Tables(1).Rows.Height = 11.35
            .Visible = True
        End With
    I'll see if I can find out why your approach doesn't seem to be working correctly.

    Regards,

    Greg M


    P.S. Oops! I've just realised you want to copy rows 2 to 80, not 20 to 80 as my code does - sorry!
    Last edited by Greg M; 05-21-2008 at 07:44 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1