SetPageSetup

Set the page setup options of one or all worksheets.

Overloads

Overload Name Description
Center Specify whether/how to center the grid on the page.
Fit Specify how to fit grid onto the printed page. Use either ZoomPercent or the FitTo properties.
General General print settings.
HeadersAndFooters Specify headers and footers.
Margins Set print margins.
Titles Specify areas on the worksheet to use as titles.


Center

Specify whether/how to center the grid on the page.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CenterHorizontally Whether to center the print area horizontally on the page.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CenterVertically Whether to center the print area vertically on the page.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE

Fit

Specify how to fit grid onto the printed page. Use either ZoomPercent or the FitTo properties.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
ZoomPercent The Print zoom factor.
FitToPagesWide Specify a number of pages wide to fit the print range into.
FitToPagesTall Specify a number of pages tall to fit the print range into.

General

General print settings.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
PrintArea The address of the print area range.
Orientation Whether to print in Landscape or Portrait mode.
Specify one of the following values or an arbitrary value: <blank>LandscapePortrait
FirstPageNumber The page number to start with.
PrintGridLines Whether to print grid lines.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
PrintRowColumnHeaders Whether to print row and column headers.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
BlackAndWhite Whether to print in black and white.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
PrintComments Select where to print comments.
Specify one of the following values or an arbitrary value: <blank>NoneAt End of WorksheetAs Displayed on Worksheet
PageOrder Select how order the pages.
Specify one of the following values or an arbitrary value: <blank>Down Then OverOver Then Down

HeadersAndFooters

Specify headers and footers.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
LeftHeader Text for the left header area.
CenterHeader Text for the center header area.
RightHeader Text for the right header area.
LeftFooter Text for the left footer area.
CenterFooter Text for the center footer area.
RightFooter Text for the right footer area.

Margins

Set print margins.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
TopMargin The top margin of the page.
BottomMargin The bottom margin of the page.
LeftMargin The left margin of the page.
RightMargin The right margin of the page.
HeaderMargin The header margin.
FooterMargin The footer margin.

Titles

Specify areas on the worksheet to use as titles.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
TitleRows Row range specification for row titles.
TitleColumns Column range specification for column titles.