PrintOut Method

Applies To

Chart object, Charts collection object, Range object, Sheets collection object, Window object, Workbook object, Worksheet object, Worksheets collection object.

Description

Prints the object.

Syntax

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

expression Required. An expression that returns an object in the Applies To list.

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. Microsoft Excel prompts the user to enter the name of the output file. There's no way to specify the name of the output file from Visual Basic.

Collate Optional Variant. True to collate multiple copies.

Remarks

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

This method applies to the Window object only when it's the Info window.

See Also

PrintArea property, PrintPreview method.

Example

This example prints the active sheet.

ActiveSheet.PrintOut