ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fit Selection to Page (https://www.excelbanter.com/excel-programming/380546-re-fit-selection-page.html)

Ron de Bruin

Fit Selection to Page
 
See answer in your other thread Shawn

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I posted a similar message yesterday but worded it so poorly I thought I
would re-post it. I have a lot of data on a sheet and a code selects part of
it. When the selected part prints out it prints out on multiple sheets. I
don't want to change the entire page setup to fit to pages wide and tall = 1.
I just want the selected area to print out on one page. Here is what I have
tried and it don't work:

Range("A1:N32").Select
With Selection
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintOut Copies:=1, Collate:=True
End With



--
Thanks
Shawn


Ron de Bruin

Fit Selection to Page
 
Here is it again

Try this tester for the selection

I will preview the printout
Delete preview:=True when it is working correct

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ron de Bruin" wrote in message ...
See answer in your other thread Shawn

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I posted a similar message yesterday but worded it so poorly I thought I
would re-post it. I have a lot of data on a sheet and a code selects part of
it. When the selected part prints out it prints out on multiple sheets. I
don't want to change the entire page setup to fit to pages wide and tall = 1.
I just want the selected area to print out on one page. Here is what I have
tried and it don't work:

Range("A1:N32").Select
With Selection
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintOut Copies:=1, Collate:=True
End With



--
Thanks
Shawn



All times are GMT +1. The time now is 03:06 AM.

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