Open In App

VBA Print Statement in Excel

Last Updated : 29 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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

 

  • [From]: Starting page of the printout.
  • [TO]: Ending page of the printout.
  • [Copies]: Number of copies of the printout.
  • [Preview]: Before it gets printed if we want to view it then we can mention TRUE otherwise FALSE.

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 to print the complete sheet.
Code-for-printing-entire-sheet

 

  • Code to print the complete sheet with its sheet name.
Code-for-printing-entire-sheet-with-name

 

  • Code to print all the sheets in the workbook.
Code-for-printing-all-sheets-in-workbook

 

  • Code to print all the data in the workbook.
Code-for-printing-all-data-in-workbook

 

  • Code to print the data which are selected.
Code-for-printing-data-selected

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads