+ Reply to Thread
Results 1 to 4 of 4

Print used range to PDF

  1. #1
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Print used range to PDF

    I thought I had this worked out, but as it turns out, not really

    The intent of the "Print to PDF" button on the worksheet is to print only a used range of cells, in this case A1:G4. The list is dynamic such that several more rows of data could be used below row 4.

    So, what I'm trying to do is print only the used range of A1 to ? based on the used rows of A:G

    As always, thank you for any assistance.
    Attached Files Attached Files

  2. #2
    Forum Contributor Dante Amor's Avatar
    Join Date
    07-24-2020
    Location
    MEXICO
    MS-Off Ver
    Excel 2013
    Posts
    212

    Re: Print used range to PDF

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Print used range to PDF

    That code looks much cleaner, but I still get a run time error "Document not saved. The document may be open, or an error may have been encountered when saving"

    Does a Save command need to be entered somewhere in the code?

    Thank You

  4. #4
    Forum Contributor Dante Amor's Avatar
    Join Date
    07-24-2020
    Location
    MEXICO
    MS-Off Ver
    Excel 2013
    Posts
    212

    Re: Print used range to PDF

    I have no problem saving as pdf.
    Try this version:

    Please Login or Register  to view this content.

+ 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] DBL Click Cell to Set Dynamic Print Range & Open Print Dialogue
    By liquidmettle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2020, 04:55 PM
  2. [SOLVED] Button To Print Specific cell Range On One Sheet In Print Selection
    By diddy47 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-03-2020, 06:23 AM
  3. Macro to print, pick next name in range, sort, print and repeat.
    By aloconnor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-23-2014, 06:00 PM
  4. Set print area of selected range then print preview if ok then print the document!
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 07:10 AM
  5. Find Print Range and Print invoices from 250 tabs in Excel
    By Mr5holesinone in forum Excel General
    Replies: 4
    Last Post: 02-24-2014, 08:19 PM
  6. [SOLVED] Need ‘Set Print Area’ Code for Dynamic Print Range based on Conditions
    By dosbirn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 12:13 PM
  7. VBA to set print range, open box asking for print qty, print, then redefine print area
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2012, 06:43 PM

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