Printing with Excel using a macro

placasse

Board Regular
Joined
Jun 14, 2010
Messages
90
Hi,
I am using Excel 2007 but 2003 format under Win 7. I am printing landscape and want to fit a specific range on one page width. This macro is used by several different user and for one of them at least, it doesn't completely fit the range width and prints additional pages with rightmost character on a different pages.

Can someone identify why it is doing this for some environments. On mine it prints correctly everytime on 3 different printers.

Thank you

Pierre

Portion of the macro

Rows("12:12").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>"
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$12"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$A$1:$ay$312"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = "Page &P"
.LeftMargin = Application.InchesToPoints(0.26)
.RightMargin = Application.InchesToPoints(0.26)
.TopMargin = Application.InchesToPoints(0.31)
.BottomMargin = Application.InchesToPoints(0.51)
.HeaderMargin = Application.InchesToPoints(0.31)
.FooterMargin = Application.InchesToPoints(0.49212)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 9
.PrintErrors = xlPrintErrorsDisplayed
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End With
Selection.AutoFilter Field:=1
Selection.AutoFilter

etc
etc
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top