+ Reply to Thread
Results 1 to 4 of 4

Print Selection To Fit Page, but also need printer dialogue pop up.

  1. #1
    Registered User
    Join Date
    09-20-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    98

    Print Selection To Fit Page, but also need printer dialogue pop up.

    Pretty much a VBA novice, so hope you all can help

    I have a multi-sheet workbook and want to add a print button to a worksheet which shows a report. This involves selection and fit to page.

    However as there are a number of printers in the building I need the printer dialogue to pop up.

    I have cobbled together the code below so far, which seems to print the required selection......however it does not fit to page. Any ideas?

    Thanks D

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Print Selection To Fit Page, but also need printer dialogue pop up.

    Maybe try
    Please Login or Register  to view this content.
    instead. Also put it outside the With statement (shouldnt matter, but its not part of the with anyway).

    Fit pages is what you want, 1x1 which is what you have.

    Why do you have titlerows and title columns set that way? As it you have it set to print rows 18:69 on every sheet and columns A:O on every sheet as if they are headers. Try commenting those out and see if it works. Since you are printing a single page you dont benefit from setting repeating headers any way.

  3. #3
    Registered User
    Join Date
    09-20-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    98

    Re: Print Selection To Fit Page, but also need printer dialogue pop up.

    I want it to print selection A18:O69 of the current worksheet, landscape and to fit on 1 page.

    What I get it this, with it small in the middle, rather than nice and big on a page.

    Excel.jpg

  4. #4
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Print Selection To Fit Page, but also need printer dialogue pop up.

    When you tell Excel to print 1 wide by 1 tall you are telling it to fit the print area within a single sheet. Rowtitles and columntitle do not accomplish that, they only tell Excel to repeat those rows/columns on every printed sheet. You want the pagesetup.printarea property. See this link. That will let you set the printable area that will then get fit into 1x1.

+ 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. Control page count and printer option in print
    By shawnsonline in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-06-2012, 09:38 AM
  2. macro to print 2 copies to default printer, then 1 copy to Adobe PDF printer
    By jwright650 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2011, 01:07 PM
  3. Printer dialogue box
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2007, 09:53 AM
  4. [SOLVED] printer pauses after each page can't just print 20 copies
    By mecato in forum Excel General
    Replies: 1
    Last Post: 06-06-2006, 01:40 PM
  5. Printer Dialogue
    By pianoman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2006, 06:15 AM
  6. Print selection in one page
    By filo666 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2005, 07:50 PM
  7. [SOLVED] Printer Dialogue
    By steveh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2005, 11:05 AM
  8. print a selection twice on the same page
    By Khalil Handal in forum Excel General
    Replies: 5
    Last Post: 04-15-2005, 07:06 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