+ Reply to Thread
Results 1 to 8 of 8

Save as PDF; fit sheet on one page

  1. #1
    Forum Contributor
    Join Date
    11-20-2014
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    177

    Save as PDF; fit sheet on one page

    Hello,

    I have this code which works:

    Please Login or Register  to view this content.
    the range and pathfile I have defined as names in the name manager.

    The only problem now is that the range is too big to fit on one page so when I use the code I get a saved file which consists of 4 pages.
    How can I add the option "Fit sheet on one page"?
    Last edited by Gaellus; 08-29-2017 at 06:27 AM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Save as PDF; fit sheet on one page

    You'd probably need to set the print area to your range, then set the .pagesetup.fitopageswide property, then when saving the pdf save the sheet not the range, but set ignoreprintareas to false.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    11-20-2014
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    177

    Re: Save as PDF; fit sheet on one page

    Unfortunately I am not that good in writing code myself, so I dont exactly understand what you mean.

    I found this code which maybe helps. Just dont know how to merge it into the code I already have.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-01-2016
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Save as PDF; fit sheet on one page

    I think I'm being daft here, but is this not possible to do without code? Just set the print layout of the document to fit on a single page. Or record a macro of setting the print area to do so, and then look at the code.

  5. #5
    Forum Contributor
    Join Date
    11-20-2014
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    177

    Re: Save as PDF; fit sheet on one page

    For some reason setting a print area does not work. I still get multiple pages in my pdf. And it is a table so it is useless then.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Save as PDF; fit sheet on one page

    See if this works for you (changes/additions in red):

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-20-2014
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    177

    Re: Save as PDF; fit sheet on one page

    It does not save the file to the pathfile but only publishes it. But again in multiple pages..

    EDIT: did something wrong the first time but that code works. Thanks Arkadi!
    Last edited by Gaellus; 08-29-2017 at 06:26 AM.

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Save as PDF; fit sheet on one page

    Gaellus, I'm glad it worked out

    Thanks for the rep, and marking the thread as solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA save sheet as PDF, fit to one PDF page, loop
    By wannabeexcelguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2015, 03:24 PM
  2. Get total pages per sheet and set page numbers in page footer by formula
    By Snoopy2003 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2013, 04:00 PM
  3. Pausing Macro to save sheet as web page
    By windme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-17-2010, 04:12 PM
  4. Macro to save sheet with same page breaks as original
    By SilverFox in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2009, 08:20 AM
  5. Save As... / Save as Web Page... how to differentiate?
    By Jörgen Ahrens in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2006, 03:00 AM
  6. [SOLVED] How do I save one page out of a 80 page report in excel?
    By bellamere in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-15-2006, 04:30 PM
  7. Save a page to a specific sheet
    By carkoe in forum Excel General
    Replies: 1
    Last Post: 12-19-2005, 10:43 AM

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