how do I change page layout in vba

S

swanno

I am trying to find the code to change the page layout from portrait to
landscape without having to rewrite the entire code again.

Nowhere in the coding does it distinctively show the page layout properties.
 
G

Gord Dibben

With Worksheets("Sheet1")
.PageSetup.Orientation = xlLandscape
.PrintOut
End With

Copied directly from VBA help on "landscape"


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