Change settings for print

J

J.W. Aldridge

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
 
G

Gord Dibben

Stick this in your current macro as below.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top