ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change settings for print (https://www.excelbanter.com/excel-programming/371929-change-settings-print.html)

J.W. Aldridge

Change settings for print
 
I have the following code that works GREAT:
However, I need to also include two more commands.

(1) change print layout to landscape
(2) print all on one page

Any suggestions?



Sub Self_set_prnt_area()
Dim lLastRow As Long

lLastRow = Range("e65536:g65536").End(xlUp).Row

ActiveSheet.PageSetup.PrintArea = Range("a1:j" & lLastRow).Address
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
End Sub


Gord Dibben

Change settings for print
 
Stick this in your current macro as below.

On 31 Aug 2006 16:47:12 -0700, "J.W. Aldridge"
wrote:

I have the following code that works GREAT:
However, I need to also include two more commands.

(1) change print layout to landscape
(2) print all on one page

Any suggestions?



Sub Self_set_prnt_area()
Dim lLastRow As Long

lLastRow = Range("e65536:g65536").End(xlUp).Row

ActiveSheet.PageSetup.PrintArea = Range("a1:j" & lLastRow).Address


With ActiveSheet.PageSetup
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
End Sub




Gord Dibben MS Excel MVP


All times are GMT +1. The time now is 06:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com