LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How to set page orientation to "landscape"

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Layout - Orientation - Landscape colin5392 Excel Discussion (Misc queries) 0 January 24th 10 10:30 AM
Pagesetup.Orientation need VBA routine to "Best Guess" Orientation [email protected] Excel Discussion (Misc queries) 3 November 10th 09 05:53 PM
How to put page numbers in side margin of landscape orientation? audit annie Excel Discussion (Misc queries) 1 May 2nd 08 05:35 PM
Orientation Landscape but want Page #s to Print Portrait vcollins Excel Discussion (Misc queries) 1 November 15th 07 11:58 PM
change default page orientation from portrait to landscape Ferds Excel Discussion (Misc queries) 1 November 7th 07 12:20 PM


All times are GMT +1. The time now is 09:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"