+ Reply to Thread
Results 1 to 2 of 2

Print to PDF Macro creating unwanted outcome

  1. #1
    Registered User
    Join Date
    05-24-2023
    Location
    USA
    MS-Off Ver
    11
    Posts
    1

    Print to PDF Macro creating unwanted outcome

    Hello,

    Please have patience with me, I have just begun learning how to use VBA literally yesterday. I created a simple macro to print an excel workbook as a PDF and it works perfectly.
    The issue I'm running into is that certain worksheets that I'm getting to work on have the print area set well beyond where the table is that actually has data in it.
    So because I have my macro set to print with all columns fitting on one page it's shrinking the view of the spreadsheet to an unreadable size.
    Essentially fitting 200+ rows of data into the upper left corner of an 8.5x11 in page. Below is a screenshot of the print preview page.

    screenshot.jpg

    Of course i know how to manually select my print area in the page layout tab, but I'm trying to find a faster way to accomplish this task because my job has a
    big focus on speed and having to fix the spreadsheet to make my macro work is ending up taking the same amount of time as it was before I created the macro in the first place.

    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Print to PDF Macro creating unwanted outcome

    Welcome to the Forum 1FrustratedCoder!

    You probably have many rows and columns that are considered part of the sheet but have no data. Select A1. Click CTRL+END. What cell do you end up in? If it's way down on row 200, then delete the unused rows and columns (don't just hit DEL to delete data, actually delete the rows and columns). Then save and close the file, open it, and try again.

    If none of that works attach your file for us to review.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. i am having problems creating a macro to print a label with
    By Andrew 1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2022, 09:54 PM
  2. Unwanted Pages - Print xx
    By Edsaid in forum Excel General
    Replies: 3
    Last Post: 01-26-2018, 10:47 AM
  3. creating a macro to print all sheets on dropdown list
    By winona123 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2016, 01:12 PM
  4. creating macro to print all columns but only rows with data
    By jkarns in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-07-2016, 11:26 AM
  5. Creating a filter and print macro
    By Winklestine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2013, 07:39 PM
  6. Creating a Macro to print worksheets
    By vonbates in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2011, 11:42 AM
  7. data table print outcome
    By arommer in forum Excel General
    Replies: 2
    Last Post: 01-23-2007, 10:26 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