ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding "fit to" into current print code (https://www.excelbanter.com/excel-programming/409062-adding-fit-into-current-print-code.html)

J.W. Aldridge

Adding "fit to" into current print code
 
I have a code that works perfectly except the image prints too small.
I have figured out the trick to change the size of the printout, but
need to implement this in my current procedure. I tried just dropping
it in but it didnt quite work, so either I am putting it in the wrong
place, or I need some additional code somewhere.


My current code:

Sub SetPrtAr_BigTest()
Dim lLastRow As Long
lLastRow = Range("I65536:K65536").End(xlUp).Row
Orientation = xlLandscape
ActiveSheet.PageSetup.PrintArea = Range("a6:N" & lLastRow).Address
End Sub


Piece I need added:

..FitToPagesWide = 1
..FitToPagesTall = 999


Thanx.

Rick Rothstein \(MVP - VB\)[_1675_]

Adding "fit to" into current print code
 
If you type FitToPagesWide (for example) into the Immediate window and, with
the cursor touching any part of it, press F1, you will be taken to the help
page for that property. On that page is an example of it (and
FitToPagesTall) being used along with some other useful information.

Rick


"J.W. Aldridge" wrote in message
...
I have a code that works perfectly except the image prints too small.
I have figured out the trick to change the size of the printout, but
need to implement this in my current procedure. I tried just dropping
it in but it didnt quite work, so either I am putting it in the wrong
place, or I need some additional code somewhere.


My current code:

Sub SetPrtAr_BigTest()
Dim lLastRow As Long
lLastRow = Range("I65536:K65536").End(xlUp).Row
Orientation = xlLandscape
ActiveSheet.PageSetup.PrintArea = Range("a6:N" & lLastRow).Address
End Sub


Piece I need added:

.FitToPagesWide = 1
.FitToPagesTall = 999


Thanx.



J.W. Aldridge

Adding "fit to" into current print code
 
Thanx. But I know how to do it that way. I just need to automate the
process because I dont have time to teach/show everyone else how to.
So, if I could just ammend the code to :

(1) self adjust the print area by this criteria -
Range("I65536:K65536").End(xlUp).Row ;

(2) set to landscape

(3) collate the pages (if more than one);

(4) adjust the "fit to" so that each page doesnt not come out small,
but rather large enough for my grandma to read on a semi-bad eye day.

I even found this code that seemingly works, but just need to self-set
the print area and allow for more than one page.

Sub test()
With ActiveSheet.PageSetup
.PrintArea = Selection.Address
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.Orientation = xlLandscape
End With
ActiveSheet.PrintOut preview:=True
End Sub

Thanx


All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com