ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fit to page (https://www.excelbanter.com/excel-programming/306348-fit-page.html)

Graham Haughs

Fit to page
 
I have a print macro which I am having difficulty forcing it to fit to the
printed page when printing.
It insists on using two pages if it is a wide print area. The procedure I
have seems very simple and works fine in all areas except this.

Sub OSect12Pr()
ActiveSheet.PageSetup.PrintArea = ""
ActiveSheet.PageSetup.PrintArea = "$AU$2:$BI$27"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.15748031496063)
.RightMargin = Application.InchesToPoints(0.15748031496063)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.393700787401575)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.Orientation = xlLandscape
.Draft = False
.FitToPagesWide = 1
.FitToPagesTall = 1

End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False,
Collate:= _
True
End Sub

I have run the procedure using the macro recorder to see where I was goig
wrong but I still ge problems. There are a whole range of worksheets in
workbook abd each sheet will have its own print area and will be printed
from the active sheet. I would welcome any help.

Kind Regards
Graham Haughs
Turriff, Scotland.



Graham[_6_]

Fit to page
 
I think I may have got this. I put in the line
..Zoom = False
This seems to have done the trick but if anyone thinks I am still off the
target then please let me know.

Graham

"Graham Haughs" wrote in message
...
I have a print macro which I am having difficulty forcing it to fit to the
printed page when printing.
It insists on using two pages if it is a wide print area. The procedure I
have seems very simple and works fine in all areas except this.

Sub OSect12Pr()
ActiveSheet.PageSetup.PrintArea = ""
ActiveSheet.PageSetup.PrintArea = "$AU$2:$BI$27"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.15748031496063)
.RightMargin = Application.InchesToPoints(0.15748031496063)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.393700787401575)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.Orientation = xlLandscape
.Draft = False
.FitToPagesWide = 1
.FitToPagesTall = 1

End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False,
Collate:= _
True
End Sub

I have run the procedure using the macro recorder to see where I was goig
wrong but I still ge problems. There are a whole range of worksheets in
workbook abd each sheet will have its own print area and will be printed
from the active sheet. I would welcome any help.

Kind Regards
Graham Haughs
Turriff, Scotland.





Tom Ogilvy

Fit to page
 
No, that is what you need to do.


--
Regards,
Tom Ogilvy


"Graham" wrote in message
...
I think I may have got this. I put in the line
.Zoom = False
This seems to have done the trick but if anyone thinks I am still off the
target then please let me know.

Graham

"Graham Haughs" wrote in message
...
I have a print macro which I am having difficulty forcing it to fit to

the
printed page when printing.
It insists on using two pages if it is a wide print area. The procedure

I
have seems very simple and works fine in all areas except this.

Sub OSect12Pr()
ActiveSheet.PageSetup.PrintArea = ""
ActiveSheet.PageSetup.PrintArea = "$AU$2:$BI$27"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.15748031496063)
.RightMargin = Application.InchesToPoints(0.15748031496063)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.393700787401575)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.Orientation = xlLandscape
.Draft = False
.FitToPagesWide = 1
.FitToPagesTall = 1

End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False,
Collate:= _
True
End Sub

I have run the procedure using the macro recorder to see where I was

goig
wrong but I still ge problems. There are a whole range of worksheets in
workbook abd each sheet will have its own print area and will be printed
from the active sheet. I would welcome any help.

Kind Regards
Graham Haughs
Turriff, Scotland.







Graham[_6_]

Fit to page
 
Thanks for the feedback Tom. It is a great thing reassurance.

Graham


"Tom Ogilvy" wrote in message
...
No, that is what you need to do.


--
Regards,
Tom Ogilvy


"Graham" wrote in message
...
I think I may have got this. I put in the line
.Zoom = False
This seems to have done the trick but if anyone thinks I am still off

the
target then please let me know.

Graham

"Graham Haughs" wrote in message
...
I have a print macro which I am having difficulty forcing it to fit to

the
printed page when printing.
It insists on using two pages if it is a wide print area. The

procedure
I
have seems very simple and works fine in all areas except this.

Sub OSect12Pr()
ActiveSheet.PageSetup.PrintArea = ""
ActiveSheet.PageSetup.PrintArea = "$AU$2:$BI$27"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.15748031496063)
.RightMargin = Application.InchesToPoints(0.15748031496063)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.393700787401575)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.Orientation = xlLandscape
.Draft = False
.FitToPagesWide = 1
.FitToPagesTall = 1

End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False,
Collate:= _
True
End Sub

I have run the procedure using the macro recorder to see where I was

goig
wrong but I still ge problems. There are a whole range of worksheets

in
workbook abd each sheet will have its own print area and will be

printed
from the active sheet. I would welcome any help.

Kind Regards
Graham Haughs
Turriff, Scotland.










All times are GMT +1. The time now is 08:57 AM.

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