VBA Code:
If Range("BA1").Value = 1 Or Range("BA1").Value = 2 Then
Range("AB7").Value = "EE #"
Range("Y1").Value = 1
lastR = Range("BC2").Value
ActiveSheet.PageSetup.PrintArea = "$A$22:$O$82,$AA$5:AX" & lastR
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0)
.BottomMargin = Application.InchesToPoints(0)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintComments = xlPrintSheetEnd
.PrintQuality = 600
.Orientation = xlPortrait
.PaperSize = xlPaperLegal
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
End With
z = ActiveSheet.PageSetup.Pages.Count
ActiveWindow.SelectedSheets.PrintOut From:=2, To:=z, copies:=x, Collate _
:=True, IgnorePrintAreas:=False
with Range("BA1").Value is 1 or 2 the macro runs through the above code fine except that it prints on Letter size paper although in the code I specified in the code ".PaperSize = xlPaperLegal"
can not seem to figure out why. Any help is greatly appreciated.