Hi

I am trying to alternate between Portrait and Landscape when printing a number of pages. The code ignores the change to Landscape and always prints Portrait even when the variable Qty value is greater than 6. Any help would be greatly appreciated

Kindest regards

Jack



If Qty <= 6 Then
Range("PrtArea").Select
ActiveSheet.PageSetup.PrintArea = "PrtArea"
Else
Range("PrtArea2").Select
ActiveSheet.PageSetup.PrintArea = "PrtArea2"
End If

Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$14"
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.RightFooter = "&D &T"
.LeftMargin = Application.CentimetersToPoints(1)
.RightMargin = Application.CentimetersToPoints(1)
.TopMargin = Application.CentimetersToPoints(1)
.BottomMargin = Application.CentimetersToPoints(1.5)
.HeaderMargin = Application.CentimetersToPoints(3)
.FooterMargin = Application.CentimetersToPoints(1)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintSheetEnd
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
If Qty <= 6 Then
.Orientation = xlPortrait
Else
.Orientation = xlLandscape
End If
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 2
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
End With
Application.PrintCommunication = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False