How to set page orientation to "landscape"

S

Steve P

Hey everybody,
I'm writing a script that evaulates a spreadsheet in excel and conditionally
formats it based on content. In addition to conditionally formatting the
spreadsheet, I also want the VBA to prep the spreadsheet for printing.

When I run the following code I am told that I am using the
XLPageOrientation property incorrectly...please advise:

With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Bold""&18Pooled Staff Level 31, 33, Interns"
.CenterFooter = "&""Arial,Bold""&10&P of &N"
.XlPageOrientation.xlLandscape
.XlPaperSize = xlPaperLegal
.TopMargin.InchesToPoints = 1
.BottomMargin.InchesToPoints = 1
.LeftMargin.InchesToPoints = 0.75
.RightMargin.InchesToPoints = 0.75
.HeaderMargin.InchesToPoints = 0.5
.FooterMargin.InchesToPoints = 0.5
.PrintTitleRows = ActiveSheet.Rows(2).Address
.PrintTitleColumns = ActiveSheet.Columns("A:B").Address
.XlOrder = xlDownThenOver
.XlObjectSize = xlFitToPage

End With
 

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