Range.PrintOut method (Excel)
Prints the object.
Syntax
expression.PrintOut (From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName)
expression A variable that represents a Range 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, Microsoft 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. |
Return value
Variant
Remarks
"Pages" in the descriptions of From and To refers to printed pages, and not to overall pages in the sheet or workbook.
Example
This example prints the active sheet.
ActiveSheet.PrintOut
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기