Skip to content

Latest commit

 

History

History
72 lines (46 loc) · 2.25 KB

Excel.Sheets.PrintOut.md

File metadata and controls

72 lines (46 loc) · 2.25 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Sheets.PrintOut method (Excel)
vbaxl10.chm152089
vbaxl10.chm152089
Excel.Sheets.PrintOut
b8e11498-4a45-b0d4-9a81-779f924e4e7e
05/15/2019
medium

Sheets.PrintOut method (Excel)

Prints the object.

Syntax

expression.PrintOut (From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, IgnorePrintAreas)

expression A variable that represents a Sheets object.

Parameters

Name Required/Optional Data type Description
From Optional Variant The number of the page at which to start printing. If this argument is omitted, printing starts at the beginning.
To Optional Variant The number of the last page to print. If this argument is omitted, printing ends with the last page.
Copies Optional Variant The number of copies to print. If this argument is omitted, one copy is printed.
Preview Optional Variant True to have Microsoft Excel invoke print preview before printing the object. False (or omitted) to print the object immediately.
ActivePrinter Optional Variant Sets the name of the active printer.
PrintToFile Optional Variant True to print to a file. If PrToFileName is not specified, Excel prompts the user to enter the name of the output file.
Collate Optional Variant True to collate multiple copies.
PrToFileName Optional Variant If PrintToFile is set to True, this argument specifies the name of the file that you want to print to.
IgnorePrintAreas Optional Variant True to ignore print areas and print the entire object.

Return value

Variant

Remarks

"Pages" in the descriptions of From and To refers to printed pages, not overall pages in the sheet or workbook.

Example

This example prints the active sheet.

ActiveSheet.PrintOut

This example prints from page 2 to page 3.

Worksheets. ("sheet1").PrintOut From:=2, To:=3

This example prints three copies from page 2 to page 3.

Worksheets. ("sheet1").PrintOut From:=2, To:=3, Copies:=3

[!includeSupport and feedback]