View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default How to set page orientation to "landscape"

try this...

..Orientation = xlLandscape
--
HTH...

Jim Thomlinson


"Steve P" wrote:

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