#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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.








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Excel 2010 files as web page or single file web page Joe Artis Excel Discussion (Misc queries) 3 April 29th 23 03:44 AM
Format page number in excel footer to start at a specific page # straitctrydncr Excel Discussion (Misc queries) 4 April 28th 23 07:45 PM
How do I do page breaks when view menu doesnt page break preview HeatherF55 Excel Discussion (Misc queries) 0 September 21st 07 04:24 AM
change and/or remove page number watermark in page break preview juga Excel Discussion (Misc queries) 2 December 25th 06 10:15 AM
Hiding the page number in page break preview background. I need coffee, wake me up! Excel Discussion (Misc queries) 0 May 15th 06 10:32 AM


All times are GMT +1. The time now is 11:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"