PageSetup Object

Description

Represents the page setup description. The PageSetup object contains all page setup attributes (left margin, bottom margin, paper size, and so on) as properties.

Using the PageSetup Object

Use the PageSetup property to return a PageSetup object. The following example sets the orientation to landscape mode and then prints the worksheet.

With Worksheets("Sheet1")
    .PageSetup.Orientation = xlLandscape
    .PrintOut
End With
The With statement makes it easier and faster to set several properties at the same time. The following example sets all the margins for worksheet one.

With Worksheets(1).PageSetup
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.75)
    .TopMargin = Application.InchesToPoints(1.5)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
End With
Properties

Application property, BlackAndWhite property, BottomMargin property, CenterFooter property, CenterHeader property, CenterHorizontally property, CenterVertically property, ChartSize property, Creator property, Draft property, FirstPageNumber property, FitToPagesTall property, FitToPagesWide property, FooterMargin property, HeaderMargin property, LeftFooter property, LeftHeader property, LeftMargin property, Order property, Orientation property, PaperSize property, Parent property, PrintArea property, PrintComments property, PrintGridlines property, PrintHeadings property, PrintNotes property, PrintTitleColumns property, PrintTitleRows property, RightFooter property, RightHeader property, RightMargin property, TopMargin property, Zoom property.

Methods

PrintQuality method.