VBA Print Statement in Excel (original) (raw)

Last Updated : 29 Oct, 2022

When there are many columns and rows in excel but we only want to save or print a few of them because that few rows and columns are important to us, at that case we will print them in Excel VBA so that we can fetch those details later and also to get the print out of that table because daily life hard copy of the reports is usually required in the meetings.

Syntax:

Syntax-for-printout

PrintOut Method Without its Parameters

Suppose, we have data as shown in the following

Dataset

Now, we want to print the report from range A1 to B9. For that, we will mention the range with the PrintOut method.

Printing-report

Printout Method With its Parameters

Now, we will print two copies of data which will first be shown to us for that we have to assign TRUE to preview the parameter.

Printout-with-parameters

Parameters of Printout Method

Code-for-printing-entire-sheet

Code-for-printing-entire-sheet-with-name

Code-for-printing-all-sheets-in-workbook

Code-for-printing-all-data-in-workbook

Code-for-printing-data-selected