Does anybody know how to change the orientation from landscape/
portrait or vice versa - i am trying to print different ranges in a
worksheet and have to change the orientation - have three differnet
ranges assigned to command buttons - they work fine but will not
change from portrait/landscape - once the first range prints it will
not change - any ideas? Code below that I have been using
Private Sub CommandButton_Click()
Range("a20").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
End Sub
Private Sub CommandButton1_Click()
ActiveSheet.PageSetup.PrintArea = "$BS$3:$BY$43"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Orientation = xlPortrait
PaperSize = xlPaperA4
Range("a20").Select
End Sub
Private Sub CommandButton2_Click()
ActiveSheet.PageSetup.PrintArea = "$ce$3:$ck$43"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("a20").Select
End Sub
Private Sub CommandButton3_Click()
Range("A10:P43").Select
Orientation = xlLandscape
PaperSize = xlPaperA4
ActiveSheet.PageSetup.PrintArea = "$A$10:$P$43"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("a20").Select
End Sub